Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Metadata file '.dll' could not be found

I am working on a WPF, C# 3.0 project, and I get this error:

Error 1 Metadata file 'WORK=- \Tools\VersionManagementSystem\BusinessLogicLayer\bin\Debug \BusinessLogicLayer.dll' could not be found C:\-=WORK=- \Tools \VersionManagementSystem\VersionManagementSystem\CSC VersionManagementSystem 

This is how I reference my usercontrols:

xmlns:vms="clr-namespace:VersionManagementSystem" <vms:SignOffProjectListing Margin="5"/> 

It happens after every failed build. The only way I can get the solution to compile is to comment out all my user controls and re-build the project, and then I uncomment the usercontrols and everything is fine.

I have checked build orders and dependencies configurations.

As you can see, it seems to have truncated the DLL file's absolute path... I have read that there is a bug with the length. Is this a possible problem?

It's very annoying and having to comment, build, and uncomment, the build is becoming extremely tiresome.

like image 240
Oliver Avatar asked Sep 14 '09 14:09

Oliver


People also ask

What is metadata file in C#?

Metadata refers to binary information saved in memory or a language runtime portable executable file. When you compile code from a portable executable file, data is added to another file section. The code is converted to MSIL (Microsoft Intermediate Language) before moving to another file partition.

How do I open a DLL file in Visual Studio 2019?

You can easily open a DLL file in Visual Studio the same way you would any other file. To do so, click File in the menu bar at the top, followed by Open. Then click File and select the DLL file you want to open and click Open. This will open the DLL file in a new Resource Editor window.


2 Answers

I just had the same problem. Visual Studio isn't building the project that's being referenced.

Written Instructions:

  1. Right click on the solution and click Properties.
  2. Click Configuration on the left.
  3. Make sure the check box under "Build" for the project it can't find is checked. If it is already checked, uncheck, hit apply and check the boxes again.
  4. (Optional) You had to do it for both Release and Debug modes on the solution properties.

Screen capture Instructions:

  • They say a picture is worth a thousand words. Click on the GIF to zoom in, and hopefully it will be easy to follow:

Gif Instructions

like image 98
Matt_Bro Avatar answered Sep 21 '22 10:09

Matt_Bro


This can still happen in newer versions of Visual Studio (I just had it happen on Visual Studio 2013):

Another thing to try is to close Visual Studio and delete the .suo file that is next to the .sln file. (It will be re-generated the next time you Save all (or exit Visual Studio)).

I've had this problem when adding new projects to the solution on another machine and then pulling the revisions in, but the .suo file can be corrupted in other cases as well and lead to very strange Visual Studio behaviour, so deleting it is one of the things I always try.

Note that deleting the .suo file will reset the startup project(s) of the solution.

More on the .suo file is here.

like image 29
corvuscorax Avatar answered Sep 22 '22 10:09

corvuscorax