Error MSB4025: Visual Studio 2015 Package Restore for .NET Core Projects Breaks

↘锁芯ラ 提交于 2019-12-23 16:30:05

问题


I was using VS Studio 2015 Professional Edition on Windows 10 Professional for developing .NET Core applications.

Everything was working fine before installing VS 2017 Edition and restarting the OS.

Now, any project I create it seems that dependencies cannot be installed:

project.json:

{
  "version": "1.0.0-*",
  "buildOptions": {
    "emitEntryPoint": true
  },

  "dependencies": {
    "Microsoft.NETCore.App": {
      "type": "platform",
      "version": "1.0.1"
    }
  },

  "frameworks": {
    "netcoreapp1.0": {
      "imports": "dnxcore50"
    }
  }
}

global.json:

    {
  "projects": [ "src", "test" ],
  "sdk": {
    "version": "1.0.0-preview2-003131"
  }
}

The SDKs installed:

Right Click the Project -> Restore Packages shows the following:

 PATH=.\node_modules\.bin;%PATH%;C:\Program Files (x86)\Microsoft Visual Studio 14.0\Web\External;C:\Program Files (x86)\Microsoft Visual Studio 14.0\Web\External\git
C:\Program Files\dotnet\dotnet.exe restore "c:\Projects\SampleApp\.vs\restore.dg" -s "C:\Program Files (x86)\Microsoft SDKs\NuGetPackages"
c:\Projects\SampleApp\.vs\restore.dg(1,1): error MSB4025: The project file could not be loaded. Data at the root level is invalid. Line 1, position 1.

However, if I go to the use the "dotnet restore" command at the project directory, it seems it restore the dependencies and works fine.

I have checked some workarounds here, but not working.

来源:https://stackoverflow.com/questions/42844245/error-msb4025-visual-studio-2015-package-restore-for-net-core-projects-breaks

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!