我使用Visual Studio 2017,我的NuGet包管理器不能始终如一地工作。 我打开了2个项目来测试这个问题,在wpfappt管理器工作中使用相同的属性和相同的名称(Wpfappt,wpfapph),但是在wpfapph它没有。
这是输出字段中的消息: wpfappt(它有效):
Restoring packages for C:\Users\Yogev\source\repos\WpfAppt\WpfAppt\WpfAppt.csproj...
GET https://api.nuget.org/v3-flatcontainer/microsoft.office.interop.excel/index.json
OK https://api.nuget.org/v3-flatcontainer/microsoft.office.interop.excel/index.json 822ms
GET https://api.nuget.org/v3-flatcontainer/microsoft.office.interop.excel/15.0.4795.1000/microsoft.office.interop.excel.15.0.4795.1000.nupkg
OK https://api.nuget.org/v3-flatcontainer/microsoft.office.interop.excel/15.0.4795.1000/microsoft.office.interop.excel.15.0.4795.1000.nupkg 185ms
Installing Microsoft.Office.Interop.Excel 15.0.4795.1000.
Committing restore...
Writing lock file to disk. Path: C:\Users\Yogev\source\repos\WpfAppt\WpfAppt\obj\project.assets.json
Restore completed in 3.62 sec for C:\Users\Yogev\source\repos\WpfAppt\WpfAppt\WpfAppt.csproj.
Successfully installed 'Microsoft.Office.Interop.Excel 15.0.4795.1000' to WpfAppt
Executing nuget actions took 3.54 sec
Time Elapsed: 00:00:10.3848087
========== Finished ==========
这是来自其他项目的消息:
Attempting to gather dependency information for package 'Newtonsoft.Json.10.0.3' with respect to project 'WpfApph', targeting '.NETFramework,Version=v4.6.1'
Gathering dependency information took 754.28 ms
Attempting to resolve dependencies for package 'Newtonsoft.Json.10.0.3' with DependencyBehavior 'Lowest'
Resolving dependency information took 0 ms
Resolving actions to install package 'Newtonsoft.Json.10.0.3'
Resolved actions to install package 'Newtonsoft.Json.10.0.3'
Retrieving package 'Newtonsoft.Json 10.0.3' from 'nuget.org'.
Adding package 'Newtonsoft.Json.10.0.3' to folder 'C:\Users\Yogev\source\repos\WpfApph\packages'
Added package 'Newtonsoft.Json.10.0.3' to folder 'C:\Users\Yogev\source\repos\WpfApph\packages'
Install failed. Rolling back...
Package 'Newtonsoft.Json.10.0.3' does not exist in project 'WpfApph'
Removing package 'Newtonsoft.Json.10.0.3' from folder 'C:\Users\Yogev\source\repos\WpfApph\packages'
**Removed package 'Newtonsoft.Json.10.0.3' from folder** 'C:\Users\Yogev\source\repos\WpfApph\packages'
Executing nuget actions took 1.1 sec
**An error occurred while writing file** 'C:\Users\Yogev\source\repos\WpfApph\WpfApph\packages.config': Failed to write packages.config as XML file 'C:\Users\Yogev\source\repos\WpfApph\WpfApph\packages.config'. Error: 'Illegal characters in path.'.
Time Elapsed: 00:00:01.8665589
========== Finished ==========
谢谢。