SEHException outside VS and no problem in debug mode running from Visual Studio  
Author Message
Tateeda





PostPosted: Common Language Runtime, SEHException outside VS and no problem in debug mode running from Visual Studio Top

P/Invoke Problem

Security

I have .Net project where I’m calling C++ DLL. It is working fine than I run it in Visual Studio Environment (debug mode). If I run the same code outside Visual Studio I’m getting External component has thrown an exception. System.Runtime.InteropServices.SEHException. The same problem exist if I run this process outside VS and attach VS de**** to this external process.

Any ideas

I think this may relate to a security, I added

[PermissionSet(SecurityAction.Demand, Name = "FullTrust")]

To my method but it did not help


.NET Development33  
 
 
nobugz





PostPosted: Common Language Runtime, SEHException outside VS and no problem in debug mode running from Visual Studio Top

It's not .NET security, you're getting an unmanaged exception. There are just a million different ways in which a C++ DLL can throw SEH exceptions. The typical reasons are heap corruption problems and bad pointers. You'll need a good unmanaged de**** to trap this exception and a working understanding of assembly code. Look at the Debugging Tools for Windows.


 
 
Tateeda





PostPosted: Common Language Runtime, SEHException outside VS and no problem in debug mode running from Visual Studio Top

Well, the real question is why it is working fine in IDE but not outside of IDE I do not get any exception while running in VS.< xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Interesting thing. the real question was not answered. Than I posted it again without security issue and ask why it would work in IDE and not outside, my post was simply deleted!!!!

Nice work at Microsoft!!!