.Net Core 1.1.0 Visual Studio工具 [英] .Net Core 1.1.0 Visual Studio Tooling

查看:134
本文介绍了.Net Core 1.1.0 Visual Studio工具的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚将asp.net核心项目从1.0.1迁移到1.1.0,并且在运行 dotnet运行 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:\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和运行时,但仍然无法创建.Net Core 1.1在Visual Studio中的.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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆