简体   繁体   English

Compiling.Net Framework Project 在命令提示符下给出 CS0006 而 Visual Studio 中没有错误,为什么?

[英]Compiling .Net Framework Project at command prompt give CS0006 while there is not error in Visual Studio, why?

Compiling.Net Framework Project at command prompt give CS0006 while there is not error in Visual Studio, why? Compiling.Net Framework Project 在命令提示符下给出 CS0006 而 Visual Studio 中没有错误,为什么?

I tried to compile with:我试图编译:

  • dotnet build点网构建
  • devenv /build开发环境/构建

Trying to commpile either the solution or the final.csproj.尝试编译解决方案或 final.csproj。

Using or not using a "dotnet restore" before compiling.在编译之前使用或不使用“dotnet restore”。

It always game me error "CS0006" in all cases.在所有情况下,它总是让我犯错误“CS0006”。

Error: (thanks to: TheGeneral to add that information in comments)错误:(感谢:TheGeneral 在评论中添加该信息)

CS0006: Metadata file 'dll_name' could not be found. CS0006:找不到元数据文件“dll_name”。 The program was compiled and explicitly passed the name of a file that contained metadata;该程序已编译并显式传递了包含元数据的文件的名称; however, the.dll was not found.但是,没有找到.dll。

After many hours and many trial and error, I finally find a way:经过数小时和多次反复试验,我终于找到了一种方法:

dotnet restore --force-evaluate
"C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\devenv" /build Debug Solution.sln

Please let met know if it works for you;-) !!!请让我们知道它是否适合您;-) !!!

暂无
暂无

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

相关问题 如何解决解决方案中现有项目的 c# CS0006 错误 - How solve c# CS0006 error from a existing project in solution 错误CS0006:找不到元数据文件'MongoDB' - Error CS0006: Metadata file 'MongoDB' could not be found vs 2015 Error CS0006 Metadata file.dll'找不到 - vs 2015 Error CS0006 Metadata file .dll' could not be found 错误 CS0006 元数据文件; 找不到fileuploadcontrol.dll' - error CS0006 metadata file; fileuploadcontrol.dll'could not be found CSC错误CS0006:找不到元数据文件'... dll' - 但文件存在 - CSC error CS0006: Metadata file '…dll' could not be found - But file exists 错误CS0006:找不到元数据文件'C:\\ Users \\ ppData \\ Local \\ Temp \\ .sonarqube \\ .static \\ csharp_1.11.0 \\ SonarAnalyzer.zip \\ SonarAnalyzer.dll - error CS0006: Metadata file 'C:\Users\ppData\Local\Temp\.sonarqube\.static\csharp_1.11.0\SonarAnalyzer.zip\SonarAnalyzer.dll' could not be found 在Visual Studio命令提示符2010中构建c#dll时如何指定.net目标框架? - How to specify .net target framework when building c# dll in Visual Studio Command Prompt 2010? 在Visual Studio 2015中构建VSIX项目时出现错误CS1759 - error CS1759 while building VSIX project in visual studio 2015 在Visual Studio中运行Asp.NET项目时出现数据库错误 - DataBase Error while running Asp.NET project in Visual Studio 警告IDE0006加载项目时遇到错误 - Warning IDE0006 Error encountered while loading the project
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM