Click here to Skip to main content
15,881,204 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have written a class library and I'm using this DLL (MyLibrary.dll) in my ASP.NET website. Locally on my machine, this works fine. However, when I publish my website to an FTP location using the functionality from Visual Studio, the website is not loading properly. I'm getting the error "Could not load type 'MyNamespace.MyClass' from assembly 'MyWebsite.dll". The problem is that, this error is in a way correct because MyNamespace.MyClass is found in the class library that is referenced from my ASP.NET website.

My question is, why is the website not referring to my DLL? What am I doing wrong here or what am I missing? So far, I made sure that, both MyWebsite.dll and MyLibrary.dll are both found in the \bin folder.
Posted
Comments
Arkadeep De 29-Mar-15 13:21pm    
Same problem I faced few days ego. In my case the path was different..
Ryan Zahra 29-Mar-15 13:24pm    
In my case, even the namespace is incorrect. It's like the website is looking for the class in a wrong namespace.
Arkadeep De 29-Mar-15 13:28pm    
exactly...If you try it with like
projectname.folder.classname then I think prob will be solved.
Ryan Zahra 30-Mar-15 12:19pm    
Sorry for the long delay but I couldn't test this out earlier. Clearly, you were 100% correct. I just needed to include the namespace before the class name and worked like a charm. If you want, add your reply as a solution so that I can mark it as an answer. Thanks again!!
Arkadeep De 30-Mar-15 12:26pm    
brilliant...Honestly speaking I didn't try it in my case, it was my assumption, it clicked. :D..put that into solution.

1 solution

If you try it with like following
using projectname.folder.classname
then I think problem will be solved.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900