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?
    – Baldrick
    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?
    – thetimmer
    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.
    – thetimmer
    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.

3
  • 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 Commented Apr 15, 2014 at 17:14
  • 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. Commented Apr 15, 2014 at 17:17
  • 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. Commented Apr 15, 2014 at 17:30

Not the answer you're looking for? Browse other questions tagged or ask your own question.