app won't run after adding an empty class

G

Guest

I'm wriiting an MFC C++ application which uses a third party C# .NET API via
a DLL. The app runs fine. If I add a new, empty C++ class, and compile/link
it refuses to run, complaining about not being able to load an assembly.
Removing the class from the project and doing a rebuild all gets it working
again. Its as though I've hit a threshold? Any ideas?

- I'm using Visual Studio 2005
- Although my code is MFC native C++, the third party API DLL uses .NET and
their code is written in C#; my app has the /clr flag enabled
- Since it runs before adding the new class, I don't think its a
config/settings issue; the new class isn't even used, its just added to the
project and is an empty class with only a constructor/destructor
- in the past we've had similar issues which required using the delay load
DLL options; I tried listing the third party API DLL and the DLLs it uses as
delay loaded and this didn't help
- I also setup DEVPATH to point to my project directory where the exe and
DLLs are

I don't know, but suspect that I've hit some sort of threshold which is
preventing load/initialization from working. The project isn't all that
large. I've tried adding a dialog class, an empty C++ class, and a C++ class
with some code in it.

Note that the failure to initialize occurs before the app code even runs,
i.e. its in the lower level startup code and complains that it can't load a
needed assembly.

Any ideas?
 
O

Oleg Starodumov

I'm wriiting an MFC C++ application which uses a third party C# .NET API via
a DLL. The app runs fine. If I add a new, empty C++ class, and compile/link
it refuses to run, complaining about not being able to load an assembly.
Removing the class from the project and doing a rebuild all gets it working
again. Its as though I've hit a threshold? Any ideas?

Which assembly could not be loaded?
Have you tried Fusion log to see why it could not be loaded?

http://www.grimes.demon.co.uk/workshops/fusWSFive.htm
 
D

David Lowndes

I'm wriiting an MFC C++ application which uses a third party C# .NET API via
a DLL. The app runs fine. If I add a new, empty C++ class, and compile/link
it refuses to run, complaining about not being able to load an assembly.

What's the exact error message you get?
Do you get any more information if you try to debug it in the IDE
(output window)?

It seems so unlikely that adding/removing an empty class that's not
being used would make any difference - are you telling us the whole
story?

Dave
 

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