找不到导入的项目DotNet.Props

时间:2017-05-18 11:27:03

标签: c# asp.net .net visual-studio

有人请。任何人。过去两天我一直在为这个问题烦恼。我已经阅读了其他相似的问题。但它们并不准确。

错误消息是:     导入的项目

" C:\ PROGRAMFILES \ DOTNET \ SDK \ 1.04 \的Microsft \ VisualStudio的\ v14.0 \ DOTNET的\ Microsoft.DotNet.Props"没找到。确认声明中的路径是否正确,以及该文件是否存在于磁盘上。

我正在尝试在安装Visual Studio 2017之前运行使用Visual Studio Express For Web 2015开发的Angular2 ASP.NET核心应用程序。我认为问题是该程序正在寻找.NET的一个版本以某种方式被删除的核心。这是我的proj.json

{
  "userSecretsId": "aspnet-Angular2-b6820071-fb17-4201-b6fd-407054319783",

  "dependencies": {
    "Microsoft.NETCore.App": "1.0.0-rc2-3002702",
    "Microsoft.ApplicationInsights.AspNetCore": "1.0.0-rc2-final",
    "Microsoft.AspNetCore.Authentication.Cookies": "1.0.0-rc2-final",
    "Microsoft.AspNetCore.Diagnostics": "1.0.0-rc2-final",
    "Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore": "1.0.0-rc2-
 final",
"Microsoft.AspNetCore.Identity.EntityFrameworkCore": "1.0.0-rc2-final",
"Microsoft.AspNetCore.Mvc": "1.0.0-rc2-final",
"Microsoft.AspNetCore.Razor.Tools": {
  "version": "1.0.0-preview1-final",
  "type": "build"
},
"Microsoft.AspNetCore.Server.IISIntegration": "1.0.0-rc2-final",
"Microsoft.AspNetCore.Server.Kestrel": "1.0.0-rc2-final",
"Microsoft.AspNetCore.StaticFiles": "1.0.0-rc2-final",
"Microsoft.EntityFrameworkCore.SqlServer": "1.0.0-rc2-final",
"Microsoft.EntityFrameworkCore.Tools": "1.0.0-preview2-final",
"Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0-rc2-final",
"Microsoft.Extensions.Configuration.Json": "1.0.0-rc2-final",
"Microsoft.Extensions.Configuration.UserSecrets": "1.0.0-rc2-final",
"Microsoft.Extensions.Logging": "1.0.0-rc2-final",
"Microsoft.Extensions.Logging.Console": "1.0.0-rc2-final",
"Microsoft.Extensions.Logging.Debug": "1.0.0-rc2-final",
"Microsoft.VisualStudio.Web.BrowserLink.Loader": "14.0.0-rc2-final",
"Microsoft.VisualStudio.Web.CodeGeneration.Tools": {
  "version": "1.0.0-preview1-final",
  "type": "build"
},
"Microsoft.VisualStudio.Web.CodeGenerators.Mvc": {
  "version": "1.0.0-preview1-final",
  "type": "build"
},
  "tools": {
        "Microsoft.AspNetCore.Razor.Tools": {
      "version": "1.0.0-preview1-final",
      "imports": "portable-net45+win8+dnxcore50"
    },
    "Microsoft.AspNetCore.Server.IISIntegration.Tools": {
      "version": "1.0.0-preview1-final",
      "imports": "portable-net45+win8+dnxcore50"
    },
    "Microsoft.EntityFrameworkCore.Tools": {
      "version": "1.0.0-preview1-final",
      "imports": [
        "portable-net45+win8+dnxcore50",
        "portable-net45+win8"
      ]
    },
    "Microsoft.Extensions.SecretManager.Tools": {
      "version": "1.0.0-preview1-final",
      "imports": "portable-net45+win8+dnxcore50"
    },
    "Microsoft.VisualStudio.Web.CodeGeneration.Tools": {
      "version": "1.0.0-preview1-final",
      "imports": [
        "portable-net45+win8+dnxcore50",
        "portable-net45+win8"
      ]
    }
  },
  "frameworks": {
    "netcoreapp1.0": {
      "imports": [
        "dotnet5.6",
        "dnxcore50",
        "portable-net45+win8"
      ]
    }
  },
  "buildOptions": {
    "emitEntryPoint": true,
    "preserveCompilationContext": true
  },
  "runtimeOptions": {
    "gcServer": true
  },
  "publishOptions": {
    "include": [
      "wwwroot",
      "Views",
      "appsettings.json",
      "web.config"
    ]
  },
    "scripts": {
          "prepublish": [ "npm install", "bower install", "gulp clean", 
    "gulp 
    min" 
    ],
      "postpublish": [ "dotnet publish-iis --publish-folder 
%publish:OutputPath% 
--framework %publish:FullTargetFramework%" ]
    },
    "EntityFramework": "6.1.3",
    "Microsoft.EntityFrameworkCore": "1.1.1"
}

这是我在尝试仅打开应用程序时收到的错误消息的屏幕截图:

enter image description here

以下是尝试运行程序时控制台中的错误消息:

enter image description here

我很感激你的指导。 谢谢, CM

1 个答案:

答案 0 :(得分:0)

要在VS 2015中继续使用基于project.json的项目,您需要在解决方案级别(global.json或以上的目录层次结构)添加具有以下内容的project.json文件:< / p>

{
  "sdk": {
    "version": "1.0.0-preview2-1-003177"
  }
}

1.0.0-preview2-1-003177替换为您计算机上安装的最新1.0.0预览版2 - 您可以将此版本作为C:\Program Files\dotnet\sdk的子文件夹找到。