views:

247

answers:

3

I'm starting deployment of my web application and I need to guarantee that all the assemblies that are going to be deployed were built using Release configuration. Our system was developed using C#/.Net 3.5.

Is there any way to achieve this?

+4  A: 

The internet is a great resource that is under used by lots of StackOverflow members.

Check this

http://stevesmithblog.com/blog/determine-whether-an-assembly-was-compiled-in-debug-mode/

David
+1  A: 

Don't deploy to production via Visual Studio. Look into Continuous Integration and scripted builds (such as with NAnt).

The F5 Key Is Not a Build Process

TrueWill
+1  A: 

I loved that David suggestion, but you could also go this way (AssemblyInfo.cs):

#if DEBUG
[assembly: AssemblyDescription("Your application assembly (DEBUG version)")]
#else if RELEASE
[assembly: AssemblyDescription("Your application assembly (RELEASE version)")]
#endif

This is more human friendly, as anyone can right-click that assembly, to select Properties and go to Details tab.

Rubens Farias