问题
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