views:

60

answers:

3

I have a web that I build with WebDeploymentProject. I thought I had build it in release mode, but now an errrormessage displays a linenumber. I have deployed a pdb file to the server. Can an assembly build in release mode display linenumbers if the pdb is present?

Is there any way to tell if an assembly is build in debug mode or release mode?

A: 

Yes. And that a .pdb file exists in addition to the .dll or .exe.

Matt Wrock
+3  A: 

Pdb files provides line number information, so there is nothing criminal in error messages.

To detect if an assembly built in debug mode inspect Debuggable attribute attached to the assembly.

actual
How can I see if this attribute is attached?
Malcolm Frexner
Use Object Browser in VS or .NET Reflector.
actual
By the way, it is not enough to see if it attached. You need to check its value, for Release mode it is typicaly has value of DebuggingModes.IgnoreSymbolStoreSequencePoints.
actual
In Object Browser I get System.Diagnostics.DebuggableAttribute(2) for release and System.Diagnostics.DebuggableAttribute(263) for debug. Thats what I needed thnx!
Malcolm Frexner
A: 

I did a little updating to get a tool called IsDebug ported to .Net 2.0 once upon a time.

It's a WinForm application - you start it up, drag your DLL onto it, it tells you whether it's compiled in debug or release mode.

48klocs