Strange goings on with VS2003 & 'System.TypeLoadException'

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

A project that previously working fine now errors with
'System.TypeLoadException' after only minor changes to the app. ( label text
changes )

When attempting to track down the source of the error by removing bits of
code, it always re-occurs, the details and location of exception change but
it is always the same type 'System.TypeLoadException'.

If I make a new project and copy all the objects in, then it will work OK
for a while; I know because I have been doing this as a work around.

Can anybody shed any light on this?
 
And if you get the full message and details from the exception you should
get an indication of what type (and what assembly) is causing the problem.
Usually this occurs if you have a reference to a project with a specific
version number, but you've rebuilt that dll and it has an auto-incrementing
version number so it no longer matches the reference.

Peter
 
Hi Peter,

Full details of one of the exceptions is shown below:

Additional information: Could not load type
Microsoft.VisualBasic.CompilerServices.ProjectData from assembly
Microsoft.VisualBasic, Version=7.0.5000.0, Culture=neutral,
PublicKeyToken=B03F5F7F11D50A3A.

If I comment out the code that generated this then I get a new one like the
following..

Additional information: Could not load type
Microsoft.VisualBasic.CompilerServices.StringType from assembly
Microsoft.VisualBasic, Version=7.0.5000.0, Culture=neutral,
PublicKeyToken=B03F5F7F11D50A3A.

And this goes on...
 
A bit more information on how I can re-create the error...

Create a new project copy all the files in and it works OK, shut VS,
restart, compile and test and then error occurs.

One thing to mention maybe...my project references a number of other class
libraries, all of which are targetted for WinCE (my platform) but everytime I
add the references I get a compatibility dialog....not sure why it does this
and whether this is relevant to my error?
 
That means one or more modules in your project are compiled against desktop
framework and thus can not be used on NETCF.

PublicKeyToken for NETCF assemblies is 969DB8053D3322AC, B03F5F7F11D50A3A is
a desktop PKT.



Most common reason for that is creating a DLL project for desktop instead of
DLL project for NETCF and using this DLL.

Make sure you don't do that.



If you're trying to use some 3rd party library, make sure it's NETCF
version. If there's no NETCF version, you can't use it.




Best regards,

Ilya

This posting is provided "AS IS" with no warranties, and confers no rights.

*** Want to find answers instantly? Here's how... ***

1. Go to
http://groups-beta.google.com/group/microsoft.public.dotnet.framework.compactframework?hl=en
2. Type your question in the text box near "Search this group" button.
3. Hit "Search this group" button.
4. Read answer(s).
 
Back
Top