首页 \ 问答 \ DotNetCore构建失败,因为缺少Microsoft.DotNet.Props(DotNetCore build fails because Microsoft.DotNet.Props is missing)

DotNetCore构建失败,因为缺少Microsoft.DotNet.Props(DotNetCore build fails because Microsoft.DotNet.Props is missing)

我正在使用Microsoft.NETCore.App版本1.1.0构建一个dotnetcore项目。 我曾尝试更新到1.1.1,但我们的项目使用的是NUnit,1.1.1尚未完全支持。 所以,我不得不回滚。 但是,作为更新的一部分,我必须安装1.1.1的.Net Core应用程序。 回滚后,我重新安装了1.1.0,构建时仍然出现以下错误:

Error   MSB4019 The imported project "C:\Program Files\dotnet\sdk\1.0.1\Microsoft\VisualStudio\v14.0\DotNet\Microsoft.DotNet.Props" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.

我在文件目录中查找了我安装的所有sdk版本,但没有一个版本具有该目录。 这一直有效,直到我今天早上尝试更新。 重新安装旧版本的.Net Core后,我不确定为什么它仍然失败。 这对我来说是一个阻碍,因为它阻止我构建和完成API的功能。 任何帮助深表感谢。

更新 :显而易见的答案是将项目移至VS2017,但不幸的是,目前这不是一个选项,因为我们的项目使用NUnit进行测试,VS2017和dotnetcore尚未完全支持。


I am building a dotnetcore project using Microsoft.NETCore.App version 1.1.0. I had tried updating to 1.1.1, but our project uses NUnit, which is not yet fully supported in 1.1.1. So, I had to roll it back. However, as part of the update, I had to install the .Net Core app of 1.1.1. After rolling back, I re-installed 1.1.0, and I still get the following error when I build:

Error   MSB4019 The imported project "C:\Program Files\dotnet\sdk\1.0.1\Microsoft\VisualStudio\v14.0\DotNet\Microsoft.DotNet.Props" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.

I looked in the file directory for all versions of the sdk that I have installed, and none of them have that directory. This worked until my attempt to update this morning. I am not sure why it still fails after reinstalling the older version of .Net Core. This is a blocker for me, as it prevents me from building and finishing a feature for an API. Any help is much appreciated.

Update: The obvious answer is to move the project to VS2017, but unfortunately that is not currently an option, as our project uses NUnit for testing, which is not yet fully supported in VS2017 and dotnetcore.


原文:https://stackoverflow.com/questions/42820921
更新时间:2022-01-12 10:01

最满意答案

要继续使用xproj和project.json,您必须只使用Visual Studio 2015和.NET Core CLI预览2.运行dotnet--info以确定您拥有的.NET Core CLI版本。 您必须使用以“1.0.0-preview2”开头的版本。 任何更新的东西都不支持xproj或project.json。

如果安装了多个版本的.NET Core CLI,则执行“dotnet.exe”将默认使用最新版本。 您可以通过向项目中添加名为“global.json”的文件并在其中设置SDK版本来控制此操作。 例:

{
  "sdk": { "version": "1.0.0-preview2-003131" }
}

To continue using xproj and project.json, you must only use Visual Studio 2015 and .NET Core CLI preview 2. Run dotnet--info to figure out which version of .NET Core CLI you have. You must use a version that starts with "1.0.0-preview2". Anything newer does not support xproj or project.json.

If you have multiple versions of .NET Core CLI installed, executing "dotnet.exe" will use the latest version by default. You can control this by adding a file named "global.json" to your project and setting the SDK version in it. Example:

{
  "sdk": { "version": "1.0.0-preview2-003131" }
}

相关问答

更多

相关文章

更多

最新问答

更多
  • Google会更新重定向网址吗?(Does Google update redirect URLs? [closed])
  • 如何将js-variable从.js文件传递给Electron中的.html页面?(How to pass js-variable from .js file to .html page in Electron?)
  • matlab中的数据处理gui - 从文件和文本框中读取并传递给函数(data handling in matlab gui - reading from file and textbox and pass to function)
  • SVG矩形的笔划宽度在顶部/左侧被切除。(SVG rectangle's stroke widths are cut off on top/left. How do I fix this?)
  • BOOST_CHECK中的错误?(Bug in BOOST_CHECK?)
  • 使用ActiveDocument时记录替换量(Recording the amount of replacements when using ActiveDocument)
  • 将php数组转换为javascript数组(convert php array to a javascript array)
  • 在斯威夫特干邑国际象棋引擎与iOS项目集成(Stockfish Chess Engine Integration with iOS project in Swift)
  • C# - 增加一个双倍值(1.212E + 25)(C# - Incrementing a double value (1.212E+25))
  • 取消asynctask的最佳方法(Best way to cancel asynctask)
  • 文件转换问题的最佳方法(Best approach to File Conversion problems)
  • 从分组数据中选择第一行和最后一行(Select first and last row from grouped data)
  • 哪些元素可以禁用?(What elements can ng-disabled be applied to?)
  • ASP.NET GridView在回发时为空(ASP.NET GridView empty on postback)
  • lua环境和模块(lua environments and modules)
  • 如何将小切片复制到更大切片的末尾(How to copy a small slice to the end of a bigger slice)
  • IIS7 URL重写模块替换(IIS7 URL Rewriting Module Replace)
  • IE和Google Chrome中的多表单提交(Multi-forms submission in IE and Google chrome)
  • Symfony2:如何在控制器中检索UserChecker?(Symfony2: How to retrieve the UserChecker in a controller?)
  • 循环通过数组和删除项目,而不破坏循环(Looping through array and removing items, without breaking for loop)
  • 如何动态更改YouTube播放器的选项(How to dynamically change YouTube player's options)
  • Laravel使用以点开头的文件处理存储磁盘(Laravel working through storage disk with files starting with dot)
  • 在挂架中使用重定向时出错(Error using redirect in pylons)
  • 替换netCDF文件中的变量(Replacing a variable inside a netCDF file)
  • 让swable中的非可变数组(let Non-mutable array in swift)
  • 春季安全缺省登录页面代码位于何处?(Where is spring security default login page code located?)
  • Unix - 并排打印公共线(Unix - Print Common Lines side by side)
  • 验证TimeSpan(Validating TimeSpan)
  • 如果还有一个具有返回值的重载版本,如何正确调用非返回值Swift函数?(How do I properly call a non-return-value Swift function when it also has an overloading version that has returned value?)
  • Perl:比较两个文件并打印匹配和不匹配的数据(Perl: Comparing two files and printing data that match and don't match)