.Net Core 1.1.0 Visual Studio 工具

2023-11-29

我刚刚将一个 asp.net core 项目从 1.0.1 迁移到 1.1.0,运行时dotnet run or dotnet restore我收到以下消息

C:\Users\you\Desktop\API\src\API\API.xproj(7,3): error MSB4019: The imported project "C:\Program Files\dotnet\sdk\1.0.0-preview4-004110\Extensions\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 和运行时,但仍然无法在 Visual Studio 中创建 .Net Core 1.1.0 项目,也无法在控制台中恢复我的包。

enter image description here

The project.json如下,按说迁移是对的,但还是搞不明白。

{
  "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它起作用了。

{
  "projects": [ "src", "test" ],
  "sdk": {
    "version": "1.0.0-preview2-1-003177" //Previously 1.0.0-preview2-003131
  }
}
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

.Net Core 1.1.0 Visual Studio 工具 的相关文章

随机推荐