.Net Core 1.1.0 Visual Studio 工具 [英] .Net Core 1.1.0 Visual Studio Tooling
问题描述
我刚刚将一个 asp.net 核心项目从 1.0.1 迁移到 1.1.0,在运行 dotnet run
或 dotnet restore
时,我收到以下消息
I've just migrated a asp.net core project from 1.0.1 to 1.1.0 and when running dotnet run
or dotnet restore
I get the following message
C:UsersyouDesktopAPIsrcAPIAPI.xproj(7,3): error MSB4019: The imported project "C:Program Filesdotnetsdk1.0.0-preview4-004110ExtensionsMicrosoftVisualStudiov14.0DotNetMicrosoft.DotNet.Props" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.
我已经安装了所有 SDK 和运行时,但仍然无法在 Visual Studio 中创建 .Net Core 1.1.0 项目,也无法在控制台中恢复我的包.
I've installed all the SDK and runtimes, but still can't neither create .Net Core 1.1.0 projects in visual studio nor restore in console my packages.
project.json
如下,按说迁移是对的,但还是想不通.
The project.json
is as follows, supposedly the migration is right, but still can't figure it out.
{
"version": "1.0.0-*",
"dependencies": {
"Microsoft.NETCore.App": {
"version": "1.1.0",
"type": "platform"
},
"Microsoft.ApplicationInsights.AspNetCore": "1.0.0",
"Microsoft.AspNetCore.Mvc": "1.0.1",
"Microsoft.AspNetCore.Routing": "1.0.1",
"Microsoft.AspNetCore.Server.IISIntegration": "1.0.0",
"Microsoft.AspNetCore.Server.Kestrel": "1.0.1",
"Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0",
"Microsoft.Extensions.Configuration.FileExtensions": "1.0.0",
"Microsoft.Extensions.Configuration.Json": "1.0.0",
"Microsoft.Extensions.Logging": "1.0.0",
"Microsoft.Extensions.Logging.Console": "1.0.0",
"Microsoft.Extensions.Logging.Debug": "1.0.0",
"Microsoft.Extensions.Options.ConfigurationExtensions": "1.0.0",
"Business.Handlers": "1.0.0-*",
"Business.Connectors": "1.0.0-*",
"Common": "1.0.0-*",
"DataAccessLayer": "1.0.0-*"
},
"tools": {
"Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.0.0-preview2-final"
},
"frameworks": {
"netcoreapp1.1": {
"imports": [
"dotnet5.6",
"portable-net45+win8"
]
}
},
"buildOptions": {
"emitEntryPoint": true,
"preserveCompilationContext": true
},
"runtimeOptions": {
"configProperties": {
"System.GC.Server": true
}
},
"publishOptions": {
"include": [
"wwwroot",
"Views",
"Areas/**/Views",
"appsettings.json",
"web.config"
]
},
"scripts": {
"postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ]
}
}
推荐答案
问题出在我的解决方案的 global.json
版本属性中,我已将其更改为 1.0.0-preview2-1-003177
并且成功了.
The problem was in the global.json
of my solution the version property, I had it changed to 1.0.0-preview2-1-003177
and it worked.
{
"projects": [ "src", "test" ],
"sdk": {
"version": "1.0.0-preview2-1-003177" //Previously 1.0.0-preview2-003131
}
}
这篇关于.Net Core 1.1.0 Visual Studio 工具的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!