Please specify the assembly explicitly in the type name.  
Author Message
William Nordgren





PostPosted: Visual C# General, Please specify the assembly explicitly in the type name. Top

I am trying to set up Global.asax and a Code behind page but I am getting the following error:

The type 'Global' is ambiguous: it could come from assembly 'C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\aaw\2de92fac\492e65b1\App_Code.gyumgjze.DLL' or from assembly 'C:\Inetpub\wwwroot\AAW\bin\App_Code.DLL'. Please specify the assembly explicitly in the type name.

How can I get the code to reference only the 'C:\Inetpub\wwwroot\AAW\bin\App_Code.DLL' file

Thanx.




Visual C#18  
 
 
mcmcom





PostPosted: Visual C# General, Please specify the assembly explicitly in the type name. Top

Delete all binaries and re-compile.

Failing that, Remove the folder listed in the error code and re-compile and re-run. Every .net app has a global.asax file and perhaps you are running two .net sites in the same location. Or your site already has a global.asax file

regards,

mcm



 
 
William Nordgren





PostPosted: Visual C# General, Please specify the assembly explicitly in the type name. Top

Here is what I did for a work around:

I published the web site and copied the \bin directory .dll files to my development \bin directory. I then added the .dll files as resources to a sub web within the same solution. The files in the primary web were then deleted and every thing is now working. I do get a message as follows:

Warning 1 Unable to update auto-refresh reference 'app_code.dll'. Can not find assembly 'C:\Inetpub\wwwroot\AAW\Bin\App_Code.dll'. C:\Inetpub\wwwroot\AAW\secure\Bin\app_code.dll.refresh http://localhost/AAW/secure/

I can update the reference by re-publishing the content. I am sure there is a safer/saner/corrector (is that a word ) way to accomplish this, so I will continue to look for the real way to do this.

Thanks for your help and maybe you now understand more about what I was trying to do.



 
 
LukeRazor





PostPosted: Visual C# General, Please specify the assembly explicitly in the type name. Top

I had the same problem.

What I had to do was delete the \bin folder so that the old 1.1 framework dlls were removed. Then I could build


 
 
mossay





PostPosted: Visual C# General, Please specify the assembly explicitly in the type name. Top

I agree with LukeRazor. It worked for me too in the same way.