Could not load type 'namespace.User' from assembly 'assemblyName, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.

Hi Folks,

 

I am having a very frustrating time trying to resolve an issue I have been experiencing. I have 1 solution which contain three different projects within it.

 

The first project has NO reference to anything in the other two.

 

The second project references the DLL produced by the first project.

 

The third project references the DLL produced by the first project and also the DLL produced by the second project.

 Now my issue is that in the third project i instantiate some web custom controls  from the DLL in the second project and the desired result is achieved.

 Now when i try and instantiate an object in the third project from the DLL that is referenced and produced from the first project I get the following :

 Could not load type 'namespace.User' from assembly 'assemblyName, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.

I have tried removing all references and deleting dll files, recompiling, deleting the temporary files in the asp.net directory. I have tried everything and i cant seem to find out whats wrong.

 If one of the assemblies works fine, why doesnt the other?

 The error suggests that the DLL could not be found and therefore could not be loaded, however i see the DLL in the directory.

 

Any help would be greatly appreciated!

 

Many thanks

 

Martin Tuncaydin

 

 

1
martin2dabo
11/15/2007 11:16:23 PM
asp.net.config-deploy 12495 articles. 0 followers. Follow

12 Replies
1390 Views

Similar Articles

[PageSpeed] 20

martin2dabo:
The error suggests that the DLL could not be found

Not quite. What it is saying is, it found the DLL, but it couldn't find a type named "namespace.User" from within that DLL. It was expecting to find that type in that particular assembly, but did not.


Cheers,
       Kevin Jones


0
vcsjones
11/16/2007 12:22:07 AM

Thanks for your reply,

 

Now, i have another question. When i load up the DLL in object explorer I see the type User() in there? What possible reason could there be that it cant find the type? Is it referencing a cached DLL thats old or not the most recent one? The one I see in the BIN directory has a time stamp that is current.

 

Thanks

0
martin2dabo
11/16/2007 12:34:54 AM

The only thing at that point, is it referencing the wrong version of the DLL for some reason.


Cheers,
       Kevin Jones


0
vcsjones
11/16/2007 12:38:21 AM

Ok,

So i built each project again, made sure that each dll was last modified to the current date and time which they were. I removed all references from each project and readded them. Still I get the same problem. This is a nightmare.

 

I appreciate your response.

0
martin2dabo
11/16/2007 12:49:50 AM

Are you sure you are adding the right references? Perhaps you are adding a reference to an older version of the DLL, and the newer one is getting compiled into another location?


Cheers,
       Kevin Jones


0
vcsjones
11/16/2007 1:00:00 AM
I am positive that the references are correct as i always check for the last modified date on the dll before adding it as a reference. It seems as if it is not using the DLL in the BIN folder and using an old version that is stored somewhere. Do the files in the temporary asp.net folder have anything to do with this?
0
martin2dabo
11/16/2007 3:33:28 AM
Ok, I just noticed something interesting. I looked in the asp.net temporary files directory and found the DLL. The size of the DLL is 24kb where as the updated one in the bin directory of the project is 28kb (both have the same modified date). Now why would it be an older version when i am building a new one all the time?
0
martin2dabo
11/16/2007 4:00:59 AM

Ok, so I have done some further tests on this issue and found something else that i quite interesting.

 

I searched my whole computer for any instance of the named DLL. I then deleted all files so my computer according to the search mechanism in windows XP has no instance of said DLL as far as I know.

 

Now, i also consolidated two of the projects into one which yielded no new results.

 

When i rebuilt the project that is causing the problems it isnt producing the correct DLL, rather it is produced a very old one that was built two weeks ago. I dont understand where this DLL can be coming from.

 

Any thoughts anyone?

 

Thanks

 

Martin

0
martin2dabo
11/16/2007 8:44:23 PM

 Have you already solved your problem ? Cause i'm dealing with the exact same problem !

0
gdt
12/11/2007 2:14:21 PM

You need to add the DLLs to the GAC. To do this, you will need to sign the assembly with a strong name prior to building the DLL. You can achieve this by going to the 'Property' settings for the DLL project in VS, and under 'Signing' you can add a strong name key.

After re-building you simply drag your new DLLs into the C:\WINDOWS\assembly folder within 'Windows Explorer'.

 

0
nezumi
12/14/2007 11:55:52 AM
In my experience, using User as a namespace node always throws a monkey in the works.  I too have the same issue (but it works locally) but when I post to my server I get errors stated above.  I renamed my namespace to something other than user and it works fine now.
0
railrhoad
8/29/2008 2:08:55 PM

 Thank you! "nezumi"

I have done the problem by doing what you said.


"Hope its your Solution so Mark it as Answer"

Ahmad Sheikh
Microsoft Valuable Geek
http://sharpcontents.blogspot.com
0
Ahmish
11/6/2008 10:47:41 AM
Reply:

Similar Artilces:

mvctoolkit Assembly 'MVCToolkit, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' uses 'System.Web.Extensions, Version=3.6.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' which has a high
I have visual studio 2008 SP 1 .I created a new MVC Web Project and added a reference to the MVCToolkit dll.I tried to build and it shows following exception Error    5    Assembly 'MVCToolkit, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' uses 'System.Web.Extensions, Version=3.6.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' which has a higher version than referenced assembly 'System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'    f:\MVC\MVCProjects\MyFirstMVCApplicati...

Could not load type 'System.Web.UI.Compatibility.CompareValidator' from assembly 'System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
 Hello everyone.i m facing Required field validators problem  with ajax.Validators works fine in my application when it runs  frm localhostBut when I deployed the application on server it stops working.the thing i was missing  <tagMapping> tag.  <tagMapping>        <add tagType="System.Web.UI.WebControls.CompareValidator" mappedTagType="System.Web.UI.Compatibility.CompareValidator, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>   &n...

Error 92 Could not load type 'System.Web.Hosting.HostingEnvironment' from assembly 'System.Web, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.
helloi'm a new  web developer i am trying to upgrad an esisting project fron visual studio 2003 to visual studio 2005 when trying to run the project i got that errorError    92    Could not load type 'System.Web.Hosting.HostingEnvironment' from assembly 'System.Web, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.        so ....any idea?  Hi tamer, It looks like Visual Studio 2005 is still trying to load the class in the 1.0 version of assemblies. Could you try removing the...

Error 92 Could not load type 'System.Web.Hosting.HostingEnvironment' from assembly 'System.Web, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. #2
hello :i am tying to upgrad an existing project from visual studio 2003 to visual studio 2005and i get the following errorrError    92    Could not load type 'System.Web.Hosting.HostingEnvironment' from assembly 'System.Web, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.        so does any one have any idea about the reason for it and how to fix it?  Hi, Please look at another of thread for more details: http://forums.asp.net/p/1210076/2139042.aspx#2139042Zhao Ji MaSincerely,Microsoft...

AJAX Beta 2
Hi... I'm experiencing a problem with the new AJAX Beta 2. When I try and put the UpdateProgess on a simple page, I get the belowCould not load type 'Microsoft.Web.UI.UpdateProgress' from assembly 'Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.TypeLoadException: Could not load type 'Microsoft.Web.UI.Up...

Could not load type 'System.Web.UI.Compatibility.CompareValidator' from assembly 'System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. (E:\SES3\Frontend\SESWe
After installingthe new Ajax release, I cannot compile my project. I tryied removing the <tagMapping>from the web.config, and was able to compile the project, BUT I go error on page: sys.argumentundefinedexception: value cannot be undefined. parameter name  Regards, Adina There is a known problem with the validators with the RTM.  More info about it here. I was getting the "Could not load type 'System.Web.UI.Compatibility.CompareValidator' from assembly 'System.Web.Extensions.." error too!  My project finally compiled correctly after removing the <tagMapping&g...

Could not load file or assembly 'XXX, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. Access is denied.
Hi,       I get this particular error only in our production environment. I have goggled and found lots of solutions. But none of them worked. My application is launched in a clustered environment (4 Web servers). And I am getting this error in all servers. I able to re-produce this error in my local environment by removing "Read & Execute" permission for this component. If this is a root cause of this particular error, then this error should occur for all other components implements in my project. I also ...

Could not load type 'System.Web.UI.ScriptReferenceBase' from assembly 'System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
on my localhost, everything is working just fine, developing a few hours... then i publish to another server (windows server 2003)...and suddenly my website is broken. i could track i down to a scriptreference in my scriptmanager - which used to work perfectly.now i don't know where it went wrong - because i developed several things, including the addition of autocomplete textbox with the control toolkitbut even after removing all the code for the autocomplete textbox, the problem wasn't solved. i seem to be the first one to have this problem, because google doesn't return anythi...

Access is denied. Could not load file or assembly 'App_Code, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies.
Hi, everyone, I made a page in asp.net and worked well, I published it in hosting and walked, after working and it throws the error to me: “Could not load cases out or assembly “App_Code, Version= 0.0.0.0, Culture=neutral, PublicKeyToken=null” or one of its dependencies. Access is denied.” I return to republicar and works.  Somebody has some idea that it is happening? Hi I get the same message in a similar situation, did you find a solution?Bw. Mark ...

Unable to create type 'live:IDLoginStatus'. Could not load file or assembly 'System.Web.Extensions, Version=3.6.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The s
Hello,  I try to use a windowslive website in visual studio 2008 with framework 3.5 I have installed the framework 3.5 and i get following error although the site is working perfect in localhost: Unable to create type 'live:IDLoginStatus'. Could not load file or assembly 'System.Web.Extensions, Version=3.6.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.After this i check my gac and i manually (with configuration tool 2.0) installed 3.6 in my gac. I still get the same error. What am i doing ...

Could not load file or assembly 'AjaxControlToolkit, Version=1.0.10618.0, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e' or one of its dependencies. The located assembly's manifest definition does
Hi, We just upgraded our application to .Net 3.5 from .Net 2.0. I updated the ajaxcontroltoolkit.dll to the corresponding version for .net 3.5 but we are getting the following error: "Could not load file or assembly 'AjaxControlToolkit, Version=1.0.10618.0, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)"  I tried to work around this using bindingredirect as following, but this did not solve the problem as I am stil...

Could not load file or assembly 'App_Web_zdfvephf, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
 When  i tried  to access  my home page  it  shows the following  Error Could not load file or assembly 'App_Web_zdfvephf, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified. Try to Find your project folder from this location, Close your Visual Studio and delete it, and restart your visual studio and then rebuild. C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files Hope you are Using ASP.NET v. 2.0. Hope this Helps,-Deepak - DeepakDon&...

Could not load file or assembly 'Compliance, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. Failed to grant minimum permission requests. (Exception from HRESULT: 0x
We recently upgraded from .NET 1.1 to .NET 3.5. The project was running fine until yesterday when I tried to create a set up project. When I add a new Websetup project and rebuild solution I get error :  Error 79 Could not load file or assembly 'Compliance, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. Failed to grant minimum permission requests. (Exception from HRESULT: 0x80131417) Y:\Development_Sites\Development_Server_RW\QMComet\SGEN Compliance Now when I run the project  , I get : Server Error in '/QMCom...

MVC Refresh
I just downloaded the new template and am trying to us it, it works fine untill I get to a Add or Edit action and then I get the following error: Could not load file or assembly 'System.Web.Mvc, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it ...