locked
C# DLL in 'Debug' mode or 'Release' mode in NuGet? RRS feed

  • Question

  • Hola,

    As a traditional .NET enterprise developer, I have been developing and building in 'Release' mode to publish the DLLs. However while publishing the DLLs for the open source NuGet, it just occurred to me to consider the pro and cons of publishing the DLLs in 'Release' mode, or for that matter in 'Debug' mode. The key here is that the DLLs are developer tools for the end-users (.NET developers) to use an API?

    Considering the DLLs in NuGet Gallery are meant for the end-developers who might debug while consuming the DLLs,

    • What are the pros and cons of publishing DLLs in 'Debug' mode?
    • What are the pros and cons of publishing DLLs in 'Release' mode?

    Please help.

    Thanks



    • Edited by CS.ASP.NET Saturday, September 28, 2013 1:01 PM typo
    Saturday, September 28, 2013 12:32 PM

Answers

  • In general you should publish the 'Release' version of a .NET dll. Note that the dlls published through NuGet aren't meant only for end-developers. Those dlls will become part of the the application said developers are building so they should be 'Release' dlls.

    Note that 'Debug' mode dlls are useful only in 2 cases:

    • If you also provide the .pdb file and the source code - this allows developers to step through the code. Technically this is possible with Release mode dlls too (see the .NET Reference source, .NET's own dlls are 'Release') but it's less reliable.
    • If the dll code contains some debug only features that may help developers during debugging - asserts for example.

    Also, NuGet related you may find this StackOverflow post useful: http://stackoverflow.com/questions/13488280/best-practices-with-nuget-debug-or-release

    • Marked as answer by CS.ASP.NET Monday, September 30, 2013 6:56 AM
    Sunday, September 29, 2013 4:14 PM

All replies

  • Check out the answer in this link

    http://social.msdn.microsoft.com/Forums/vstudio/en-US/74db169a-e244-496e-ae97-8dfec18ff2e5/what-is-the-difference-between-debug-mode-and-release-mode


    Please remember to 'Mark as Answer' the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Saturday, September 28, 2013 1:19 PM
  • Check out the answer in this link http://

    social.msdn.microsoft.com/Forums/vstudio/en-US/74db169a-e244-496e-ae97-8dfec18ff2e5/what-is-the-difference-between-debug-mode-and-release-mode


    Please remember to 'Mark as Answer' the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Thanks for the reply.

    Question: What's best for NuGet Release (Please choose either A or B without ambiguity)?

    Choose your best Answer:

    • A) DLL in 'Release' mode 
    • B) DLL in 'Debug' mode

    PS: For the benefit of .NET rookies:

    What is NuGet?

    NuGet is the package manager for the Microsoft development platform including .NET. The NuGet client tools provide the ability to produce and consume packages. The NuGet Gallery is the central package repository used by all package authors and consumers.



    • Edited by CS.ASP.NET Sunday, September 29, 2013 3:59 PM typo
    Sunday, September 29, 2013 3:58 PM
  • In general you should publish the 'Release' version of a .NET dll. Note that the dlls published through NuGet aren't meant only for end-developers. Those dlls will become part of the the application said developers are building so they should be 'Release' dlls.

    Note that 'Debug' mode dlls are useful only in 2 cases:

    • If you also provide the .pdb file and the source code - this allows developers to step through the code. Technically this is possible with Release mode dlls too (see the .NET Reference source, .NET's own dlls are 'Release') but it's less reliable.
    • If the dll code contains some debug only features that may help developers during debugging - asserts for example.

    Also, NuGet related you may find this StackOverflow post useful: http://stackoverflow.com/questions/13488280/best-practices-with-nuget-debug-or-release

    • Marked as answer by CS.ASP.NET Monday, September 30, 2013 6:56 AM
    Sunday, September 29, 2013 4:14 PM
  • In general you should publish the 'Release' version of a .NET dll. Note that the dlls published through NuGet aren't meant only for end-developers. Those dlls will become part of the the application said developers are building so they should be 'Release' dlls.

    Note that 'Debug' mode dlls are useful only in 2 cases:

    • If you also provide the .pdb file and the source code - this allows developers to step through the code. Technically this is possible with Release mode dlls too (see the .NET Reference source, .NET's own dlls are 'Release') but it's less reliable.
    • If the dll code contains some debug only features that may help developers during debugging - asserts for example.


    Thank you for the answer.
    Monday, September 30, 2013 7:00 AM