Geeks With Blogs

News



Microsoft Store

Support This Site


AddThis Social Bookmark Button

Locations of visitors to this page

Subscribers to this feed

TwitterCounter for @sdorman

Creative Commons License


Scott Dorman Microsoft MVP, Software Architect, Developer, Author

Have you ever wanted to know if a compiled assembly was compiled in Debug or Release mode? I know I have.

I came across a post on Computer Zen today that shows exactly how to do this. There is also a similar tool written by Jeff Key, called IsDebug.

For my part, I always make sure that the following snippet of code is in my AssemblyInfo.cs

#if (Debug || DEBUG)
[assembly: AssemblyConfiguration("Debug")]
#else
[assembly: AssemblyConfiguration("Release")]
#endif

This attribute doesn't show up in the file properties (when viewed from Explorer) but it can be queried programmatically.

Posted on Saturday, September 2, 2006 12:02 PM .NET (General) , .NET (C#) | Back to top

Copyright © Scott Dorman | Powered by: GeeksWithBlogs.net