繁体   English   中英

Nuget似乎在Visual Studio 2017中不起作用(仅.net Core)

[英]Nuget seems to not work in Visual Studio 2017 (.net Core only)

我安装了最新版本的.NET Core,最新版本的Visual Studio 2017和最新版本的NuGet。 当我创建一个全新的ASP.NET Core Web应用程序(MVC)时,该项目似乎没有创建一个有效的项目。 Dependencies项目有一个警告标签,当我单击它时,我看到带有警告标签的NuGet,然后在它下面是带有警告符号的Microsfot.AspNetCore.All。

在此处输入图片说明

当我尝试执行NuGet还原时,它告诉我“操作失败,因为无法加载项目WebApplicaction4的详细信息。” 如果在解决方案资源管理器中单击Microsoft.AspNetCore.All条目,VS 2017崩溃。

当我运行.NET Framework(仅Core)时,我没有这个问题。

编辑:

-我正在运行.NET Core 2.1.2

-当我运行dotnet new mvc --name WebApplication6然后运行nuget restore一切都可以正常运行,但是当我在VS中打开该应用程序时,将得到与下图相同的错误显示

这是通过Visual Studio的GUI创建的应用程序的命令行错误消息:

C:\Users\Alan O'Kelly\source\repos\WebApplication4\WebApplication5>nuget restore

WARNING: Could not load file or assembly 'HolographicExtensions.dll' or one of its dependencies. The module was expected to contain an assembly manifest. WARNING: Could not load file or assembly 'PerceptionSimulationExtensions.dll' or one of its dependencies. The module was expected to contain an assembly manifest. WARNING: Could not load file or assembly 'Windows.Devices.Printers.Extensions.dll' or one of its dependencies. The module was expected to contain an assembly manifest. MSBuild auto-detection: using msbuild version '15.5.180.51428' from 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Professional\\MSBuild\\15.0\\bin'. C:\\Users\\Alan O'Kelly\\AppData\\Local\\Temp\\NuGetScratch\\luqctw30.ycr.nugetrestore.targets(241,5): error MSB4062: The "NuGet.Build.Tasks.WarnForInvalidProjectsTask" task could not be loaded from the assembly C:\\WINDOWS\\system32\\nuget.exe. Could not load file or assembly 'file:///C:\\WINDOWS\\system32\\nuget.exe' or one of its dependencies. The system cannot find the file specified. Confirm that the <UsingTask> declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask. [C:\\Users\\Alan O'Kelly\\AppData\\Local\\Temp\\NuGetScratch\\dh1tmbpr.th1.nugetinputs.targets]

MSbuild和NuGet在项目路径中的某些字符可能有问题。

将项目移出包含单引号'字符的目录层次结构。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM