GianT971
GianT971

Reputation: 4523

In .NET, how to identify if a C++ DLL is in DEBUG or RELEASE build?

thanks to some resource of the web, I made a little tool to know whether my .NET dll is in debug or in release build; but I'd like it to work also for c/c++ DLLs.

Does anyone have some piece of code about this? The DLLs are compiled using Visual Studio.

Upvotes: 2

Views: 615

Answers (3)

Mike Miller
Mike Miller

Reputation: 16575

This is not 100% but take a look at this.

http://msdn.microsoft.com/en-us/library/system.diagnostics.fileversioninfo.isdebug.aspx

Upvotes: 1

David Brabant
David Brabant

Reputation: 43459

Information is usually contained in the PE header. You can write some code for parsing it.

Upvotes: 0

Ignacio Soler Garcia
Ignacio Soler Garcia

Reputation: 21855

As far as I know there is no way of telling such thing just looking at the DLL. In our work we use different names for debug dlls (adding a D at the end) and using preprocessor stuff.

As Debug or Release builds are just a set of properties for the compiler you could end up with a Debug build that compiles like a Release does and the other way around.

Summarizing, I think there is no way, sorry.

Upvotes: 1

Related Questions