Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ASP.NET Page says I need to reference an assembly that does not exist!

My asp.net site has to run on several client servers. It's working fine on a majority of them, but a couple have run into an error message on a few pages:

Compiler Error Message: CS0012: The type 'MetaNameValuePair' is defined in an assembly that is not referenced. You must add a reference to assembly 'App_Code.t_3vcono, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'.

The type 'MetaNameValuePair' is actually defined in a .cs file within my App_Code folder, not an external assembly. Is it failing to compile that .cs file?

like image 876
Jake Stevenson Avatar asked Jan 30 '09 16:01

Jake Stevenson


People also ask

Is defined in an assembly that is not referenced you must add a reference to?

The type 'System. Attribute' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.

How do I fix CS0012?

You could resolve this CS0012 by compiling with /reference:cs0012b. dll;cs0012a. dll , or in Visual Studio by using the Add Reference Dialog Box to add a reference to cs0012a. dll in addition to cs0012b.


2 Answers

Attempt 1:

A similar question was asked a couple of months back and look at those answers.

Attempt 2:

Have you cleared the "Temporary ASP.Net Files" for the site, usually found at C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files? There may be an old copy lingering around.

like image 76
JB King Avatar answered Nov 15 '22 20:11

JB King


Had this numerous times. The solution is to close and open Visual Studio.

In my case at least it seemed to hove something to do wit

like image 44
Karlth Avatar answered Nov 15 '22 20:11

Karlth