0

I have a previously created project written in VB.Net. I have a website that is written in C# referencing the VB project. The VB project is a class that accesses the database. It compiles and runs fine on my local machine. When I put it on the server, I get the following error

Cannot load type 'DLLOM.clsDB, DLLOM, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.

This is the code it is failing on

DLLOM.clsDB objDB = (DLLOM.clsDB)Activator.GetObject(typeof(DLLOM.clsDB), ConfigurationManager.AppSettings["RemotingPathDB." + System.Environment.MachineName.ToUpper()]);
DataSet ds = objDB.MembershipsGet();

Any idea on why it is correctly referenced on my machine, but not on the server? The website is compiled on 3.5 framework, while the VB class is 2.0. I tried switching them to no avail.

6
  • Are both your local machine and the server the same bitness? Commented Apr 15, 2014 at 15:25
  • Yes they are both 64 bit machines. Commented Apr 15, 2014 at 15:34
  • Did you verify the dll made it up to the server? Commented Apr 15, 2014 at 15:55
  • Yes the dll is in the bin folder. Commented Apr 15, 2014 at 16:00
  • If you haven't yet check out Fusion Log Viewer. stackoverflow.com/questions/7859611/… Maybe the issue is a dependency of the dll. Commented Apr 15, 2014 at 16:05

1 Answer 1

1

Cannot load type 'DLLOM.clsDB, DLLOM, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.

It is a TypeLoadException. That's the boring part, it doesn't get interesting until you start looking at the InnerException. Which tells you what really happened to stop the type from getting loaded.

If this is all you got out of your program then you need to improve your exception reporting. Be sure to use the exception's ToString() method instead of the Message property. You'll get everything, including the inner exceptions. If you get it in the debugger then be sure to use the Exception Assistant.

Sign up to request clarification or add additional context in comments.

3 Comments

Here is the stack trace: Cannot load type 'DLLOM.clsDB, DLLOM, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.] System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) +7605647 System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type) +275 DLLOM.clsDB.MembershipsGet() in C:\VSSWorking\LLMC\DLL\DLLOM\clsDB.vb:5949 CorporateV2.Default.LoadMemberships() in C:\VSSWorking\LLMC\DLL\CorporateV2\CorporateV2\Default.aspx.cs:27 CorporateV2.Default.Page_Load(Object sender, EventArgs e) in
You are not doing what I recommended you do. You have to get to the InnerException. It is unclear to me what help you need to find it. If you use the debugger then Debug + Exceptions, tick the Thrown checkboxes is another way to look at the exceptions one by one.
I set up the site to write to a log file, and there is no inner exception for where this is erroring out. That is why I put the stack trace because that seems to be the only error I am receiving.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.