Problems referenceing Class Library (.dll)

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.
 
P

Patrick Steele [MVP]

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).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top