【问题标题】:.Net Core 1.1.0 Visual Studio Tooling.Net Core 1.1.0 Visual Studio 工具
【发布时间】:2017-04-07 01:23:34
【问题描述】:

我刚刚将一个 asp.net 核心项目从 1.0.1 迁移到 1.1.0,并且在运行 dotnet rundotnet 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 项目,也无法在控制台中恢复我的包。

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%" ]
  }
}

【问题讨论】:

  • 更新您的软件包以使用 1.1.0 版本。例如:从"Microsoft.AspNetCore.Mvc": "1.0.1","Microsoft.AspNetCore.Mvc": "1.1.0",

标签: asp.net visual-studio asp.net-core .net-core


【解决方案1】:

问题出在我的解决方案的 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
  }
}

【讨论】:

  • 你是说工具?
  • 不,在解决方案目录中有一个global.json,它在属性version 中有.Net 版本。
  • @J._Pichardo,有关系吗? hanselman.com/blog/…
  • 是的,这正是我的问题和解决方案。我没看到。
  • 今天才发布
【解决方案2】:

您需要从 Microsoft 网站下载 .NET Core 1.1 SDK - Installer。如果您也只能下载运行时。以下是相同的网址。

https://www.microsoft.com/net/download/core

详情请看下图。

.net core 1.1.0

问候, 萨钦帕瓦尔

【讨论】:

  • 谢谢@Sachin,但我已经这样做了,答案在上面,还有一个链接到 Scott Hanselman 的博客解决了同样的问题。
猜你喜欢
  • 2017-04-01
  • 2023-03-22
  • 2017-05-28
  • 1970-01-01
  • 2012-03-20
  • 2023-01-30
  • 1970-01-01
  • 1970-01-01
  • 2017-07-03
相关资源
最近更新 更多