Problems referenceing Class Library (.dll)

  • Thread starter Thread starter raican
  • Start date Start date
R

raican

I've been working on a series of classes for several months, and they
all work in the original project. Today i decided to move the .cs file
to a separate project to compile it as a .dll class library. It
compiled ok, and the original project compiles and runs with the new
..dll referenced, but causes an exception whenever the classes is
accessed.

Error:
{
An unhandled exception of type 'System.TypeLoadException' occurred in
system.windows.forms.dll

Additional information: Could not load type raican.SuDoku.dokuGrid from
assembly raicanSuDoku, Version=1.0.2050.33182, Culture=neutral,
PublicKeyToken=null.
}

Any clues would be appreciated.

Thx.
 
I've been working on a series of classes for several months, and they
all work in the original project. Today i decided to move the .cs file
to a separate project to compile it as a .dll class library. It
compiled ok, and the original project compiles and runs with the new
.dll referenced, but causes an exception whenever the classes is
accessed.

Error:
{
An unhandled exception of type 'System.TypeLoadException' occurred in
system.windows.forms.dll

Additional information: Could not load type raican.SuDoku.dokuGrid from
assembly raicanSuDoku, Version=1.0.2050.33182, Culture=neutral,
PublicKeyToken=null.
}

Any clues would be appreciated.

Did you strong-name your DLL class library? If so, make sure you create
a fixed assembly version number in AssemblyInfo.cs. The default # is
1.0.* which means VS.NET changes the version # every time you recompile
(and then your other app that had a reference to a particular version
can't find it and bombs out with a TypeLoadException).
 
Back
Top