简体   繁体   中英

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. when I build or rebuild again, it is always empty and I have a Error CS0006 Metadata file.dll' could not be found error. I've checked the build configuration manager and the boxes are checked to have it output to the debug folder. 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..

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.

I got the same error message.

I referenced core class library (netcore) to core (xproj) application.

Problem was, that I had changed by manual editing in the xproj project, the output path:

to

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

but my xproj application had:

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

Changing to the same output path helped.

Check if the .nuget directory is complete.

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.

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. There is likely a better solution though, and I don't know that I would try the above with real data at stake.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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