none
FileVersionInfo.IsDebug property always returns false

    Question

  • Hi,

    I am trying to find wether the dll is compiled with debug or not.. for that I have used

    FileVersionInfo

    fileVersionInfo = System.Diagnostics.FileVersionInfo.GetVersionInfo("sample.dll");

    but fileVersionInfo.IsDebug property always return false even I built the dll with debug configuration.

    Someother dlls are returns true perfectly.

    Kindly provide proper solution/suggestion to resolve the issue. or

    provide other API to return reliable value always.

    Thanks,

    Bharathraj.

    Tuesday, July 5, 2016 11:15 AM

Answers

All replies

  • I am trying to find wether the dll is compiled with debug or not.. for that I have used
    but fileVersionInfo.IsDebug property always return false even I built the dll with debug configuration.
    Someother dlls are returns true perfectly.

    The documentation says:

    "Version resources are typically specified in a Win32 resource file,
    or in assembly attributes. For example the IsDebug property reflects
    the VS_FF_DEBUG flag value in the file's VS_FIXEDFILEINFO block, which
    is built from the VERSIONINFO resource in a Win32 resource file"

    So, if the tool you use to build your DLL isn't setting that flag for
    a debug build, that's the reason.

    To verify this is the case, try loading the DLL into VS and examine
    the version resource.

    Dave

    Tuesday, July 5, 2016 11:35 AM
  • I'd probably try them over here.

    https://social.msdn.microsoft.com/Forums/vstudio/en-US/home?forum=csharpgeneral%2Cvbgeneral%2Cvcgeneral&filter=alltypes&sort=lastpostdesc

     

     

     



    Regards, Dave Patrick ....
    Microsoft Certified Professional
    Microsoft MVP [Windows Server] Datacenter Management

    Disclaimer: This posting is provided "AS IS" with no warranties or guarantees, and confers no rights.

    Tuesday, July 5, 2016 12:16 PM
    Moderator