On an ASP.NET page, I need to reference an assembly that does not exist!

My asp.net site should run on multiple client servers. It works fine on most of them, but the couple ran an error message on several pages:

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

The type MetaNameValuePair is actually defined in the .cs file in my App_Code folder, and not on the external assembly. Can't compile this .cs file?

+10
compilation
Jan 30 '09 at 16:52
source share
5 answers

Attempt 1:

A similar question was asked a couple of months ago and looked at these answers.

Attempt 2:

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

+11
Jan 30 '09 at 16:56
source share
— -

In some special cases, you can get rid of this by disabling batch compilation in the Web.config file as follows:

<system.web> ... <compilation debug="true" targetFramework="4.0" batch="false" /> ... </system.web> 

After compilation, you can change the value back to True or remove the "batch" attribute, and then rebuild successfully.

+8
Dec 10 2018-10-10
source share

None of the solutions worked for me. The code he complains about is this:

 thisSession = ((SiteMasterPage)this.Master).foo; 

I bring the main page of the general page profile to a specific main page, which gives me access to the foo object on the main page of the page, which is a complex object with trivial user data.

If you want to know why I am doing this, this is because so far this is the best solution. Requirements dictate that I cannot extend the page class, session variables, or cookies, and this must be user-specific data.

I do not have enough reputation for comments, so I have to answer in reply. :(

0
Oct 27 '15 at 13:47
source share

The above solutions worked for me in the past, but not this time.

I finally found the reason: one of these tags on the server side (for example, <% # Eval ("Something")%> ) from the control attribute on the aspx page.

I would add it shortly before the problem appeared, and removing it made the problem go away. This was in a TemplateField on a GridView.

Unusual, but here's what the trick did.

0
Nov 30 '15 at 10:05
source share

It has been many times. The solution is to close and open Visual Studio.

At least in my case it seemed like something

0
Aug 22 '19 at 8:41
source share



All Articles