Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

csc error cs0006 metadata file could not be found building a .net 3.5 application with TFS 2012

We are upgrading from TFS 2008 to TFS 2012. Majority of our applications are .net 3.5 applications.
We have setup a TFS 2012 environment and went through migration process. When we attempt to build our .net 3.5 applications we are getting the error:

csc error cs0006 metadata file could not be found........ 

If we take a .net 3.5 application, upgrade it to .net 4.x, then run the build again, it works just fine.

I cannot upgrade every single application I have during this migration. Is there something I might be missing either in the migration or on my build box to support 3.5?

I have VS 2008, 2010, 2012 installed on my build server. I have .net frameworks installed, etc.

Any assistance is helpful.

like image 219
Kevin Price Avatar asked Jan 23 '13 22:01

Kevin Price


People also ask

What is DLL could not be found?

You may have simply accidentally deleted the DLL file. Most DLL errors come in the "DLL Not Found" and "Missing DLL" form. The easiest possible cause of a DLL error like this is that you've deleted the DLL file without realizing it.


2 Answers

The project dependencies and project build order can be specified in Visual Studio 2012 by right clicking on the project in the solution explorer and selecting Project Dependencies. By doing this action, your solution file will be fixed. In my case I was able to fix this problem without manually editing the solution files.

like image 146
Vasudevan Kannan Avatar answered Sep 28 '22 15:09

Vasudevan Kannan


We get these problems switching between branches (with significant changes). When it happens I recommend the following:

  • Close Visual Studio
  • Close w3wp.exe instances (paranoid and only if you're hosting via local IIS)
  • Search for and delete all bin and obj folders
  • Clean out all intermediate JIT compiled assemblies from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\

Following this set of will do what "Clean solution" should do, but doesn't. Essentially we're trying to remove any chance whatsoever of anything being cached anywhere (which is the most common cause of these issues).

Of course your mileage may vary, but for us with 120 projects and 1.3 million lines of code refactors regularly throw this issue up and it resolves it reliably.

like image 30
Paul Carroll Avatar answered Sep 28 '22 15:09

Paul Carroll