简体   繁体   English

vs 2015 Error CS0006 Metadata file.dll'找不到

[英]vs 2015 Error CS0006 Metadata file .dll' could not be found

I am trying to add two new test projects to my solution.我正在尝试向我的解决方案中添加两个新的测试项目。 When I add them and add references, the build initially creates the dll's in the debug folder.当我添加它们并添加引用时,构建最初会在调试文件夹中创建 dll。 when I build or rebuild again, it is always empty and I have a Error CS0006 Metadata file.dll' could not be found error.当我再次构建或重建时,它总是空的,并且出现错误 CS0006 Metadata file.dll' could not be found 错误。 I've checked the build configuration manager and the boxes are checked to have it output to the debug folder.我已经检查了构建配置管理器并选中了将其 output 放入调试文件夹的框。 I've tried clean, build, rebuild on the solution, I've made sure there were no other left-over projects laying around and deleted them.我已经尝试清理、构建、重建解决方案,我确保没有其他遗留项目并删除它们。 I'm not sure what else I can do to get it to build and output the dll's..我不确定我还能做些什么来构建它和 output dll 的 ..

I fixed this by adding the target project as a dependency.我通过将目标项目添加为依赖项来解决此问题。

Right-click on the Solution in Solution Explorer, select Project Dependencies, choose a test project, and select the project from which the dll is built.右键单击解决方案资源管理器中的解决方案,选择项目依赖项,选择一个测试项目,然后选择构建 dll 的项目。

I got the same error message.我收到了同样的错误信息。

I referenced core class library (netcore) to core (xproj) application.我将核心类库 (netcore) 引用到核心 (xproj) 应用程序。

Problem was, that I had changed by manual editing in the xproj project, the output path:问题是,我在 xproj 项目中通过手动编辑更改了输出路径:

to

<OutputPath Condition="'$(OutputPath)'=='' ">..\bin\</OutputPath>

but my xproj application had:但我的 xproj 应用程序有:

<OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath>

Changing to the same output path helped.更改为相同的输出路径有帮助。

Check if the .nuget directory is complete.检查 .nuget 目录是否完整。

File names:文件名:

-NuGet.Config
-NuGet.exe
-NuGet.targets
-packages.config

In my case NuGet.exe was missing from the branch, because when I check in on TFS, it does not send NuGet.exe.在我的情况下,分支中缺少 NuGet.exe,因为当我在 TFS 上签入时,它不会发送 NuGet.exe。

I had similar issue.我有类似的问题。 Problem started when I canceled compilation manually.当我手动取消编译时开始出现问题。

To solve it, I started compiling projects one by one.为了解决这个问题,我开始一个一个地编译项目。 Reading output of compilation allowed to spot the root project that was not compiled.读取编译输出可以发现未编译的根项目。 That root project had an error.那个根项目有错误。 And somehow that error was not reported, looks like due to canceling compilation manually.不知何故没有报告该错误,看起来是由于手动取消编译。

I went to that root project, fixed the error.我去了那个根项目,修复了错误。 Compiled it only that project.只编译那个项目。 Then compiled the whole solution.然后编译整个解决方案。 And it got fixed.它得到了修复。

I got a similar error.我遇到了类似的错误。 It turned out to be an issue with the database migrations.原来是数据库迁移的问题。 Unfortunately, I could not fix the issue.不幸的是,我无法解决这个问题。

My solution was to delete the migrations and the DB.我的解决方案是删除迁移和数据库。 When I added migrations again, everything was working.当我再次添加迁移时,一切正常。 It should be possible to delete the migrations from the Db as well as from the .net migrations folder and then treat the project as database first.应该可以从 Db 以及 .net 迁移文件夹中删除迁移,然后首先将项目视为数据库。 There is likely a better solution though, and I don't know that I would try the above with real data at stake.虽然可能有更好的解决方案,但我不知道我是否会在涉及真实数据的情况下尝试上述方法。

暂无
暂无

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

相关问题 错误CS0006:找不到元数据文件&#39;MongoDB&#39; - Error CS0006: Metadata file 'MongoDB' could not be found CSC错误CS0006:找不到元数据文件&#39;... dll&#39; - 但文件存在 - CSC error CS0006: Metadata file '…dll' could not be found - But file exists 错误 CS0006 元数据文件; 找不到fileuploadcontrol.dll&#39; - error CS0006 metadata file; fileuploadcontrol.dll'could not be found 错误CS0006:找不到元数据文件&#39;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 找不到元数据文件“.dll” - Metadata file '.dll' could not be found 如何解决解决方案中现有项目的 c# CS0006 错误 - How solve c# CS0006 error from a existing project in solution 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? 找不到元数据文件.dll - Metadata file .dll could not be found mono mcs&#39;Winforms Hello World&#39;给出编译错误CS006:找不到元数据文件&#39;cscompmgd.dll&#39; - mono mcs 'Winforms Hello World' gives compile error CS006: Metadata file 'cscompmgd.dll' could not be found 找不到元数据文件的Facades CSC错误 - Metadata file facades dll could not be found CSC error
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM