views:

43

answers:

2

I have a DLL supplied by a 3rd party along with an accompanying .NET 2.0 assembly that wraps it. If I create a .NET 3.5 project with VS2008 I am able to call into the DLL via the wrapper assembly and it works OK. However, if I create an equivalent .NET 4.0 project with VS2010 then I get a R6030 - CRT not initialized error in a message box at the time the DLL is loaded.

Is there something I can do to get this to work in a .NET 4.0 project? Could it be related to the CAS changes, or something else?

I'm carrying on with my work in VS2008 for now, but it would be good to understand what's happening...

+1  A: 

Does it happen only on debugging or also in running as well?

Two things come into mind:

1) Default application type for .NET is targeted at .NET Client Framework which is most annoying and I have to change it all the time. You could get all sorts of wierd errors if you keep it as client which at face have nothing to do it. Try changing that.

2) Do you need VS 2010 or .NET 4.0? If only VS 2010 then you can set the target framework to 3.5 and try to see if the problem is VS 2010 or .NET 4.0.

From looking at the error on internet, it looks like this is a timing issue and C runtime is not loaded - a behaviour which looks like changed in .NET 4.0. I have no idea how to fix it.

Aliostad
+4  A: 
Richard
That fits with what I'm seeing; it just happens that the 2.0 CLR uses the correct CRT version. Thanks!
GraemeF