Difference between debug and publish configuration during code publish via visual studio 2022. Not while running code. - ASPNETCORE

ASR 671 Reputation points
2022-11-29T09:50:07.347+00:00

Hi All,
I am trying to publish my ASPNETCORE MVC application via visual studio to a folder. There are two types of configuration available "Debug" and "Release". I know Release applies optimizations to our code etc etc.

I wanted to know what are the things I can check if published code is Release or Debug. If I select debug, how can I debug that code, because code is published to a folder and hosted on IIS.

If we have two options during publish, then both features have some unique feature. So what are the advantages of one over another.

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,156 questions
Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
4,595 questions
Visual Studio Debugging
Visual Studio Debugging
Visual Studio: A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.Debugging: The act or process of detecting, locating, and correcting logical or syntactical errors in a program or malfunctions in hardware. In hardware contexts, the term troubleshoot is the term more frequently used, especially if the problem is major.
938 questions
0 comments No comments
{count} votes

Accepted answer
  1. Tianyu Sun-MSFT 27,181 Reputation points Microsoft Vendor
    2022-11-29T13:03:49.953+00:00

    Hi @ASR ,

    Welcome to Microsoft Q&A forum.

    You may use "Attach to Process" feature to debug the deployed ASP .NET Core application. See this document: Remote Debug ASP .NET Core on a Remote IIS Computer in Visual Studio for more details.

    To debug an ASP .NET Core application that has been deployed to IIS … and then attach to your running app from Visual Studio.

    Debug and Release are what they are, as you know. You cannot debug your web app with release mode, so if you want to debug it, you need to set the configuration to Debug. Since Release applies optimizations to the codes etc., it is recommended to publish your project by setting the configuration to Release, otherwise the performance will be impacted(Debug mode greatly reduces the performance of your app).

    Feel free to contact us.

    Best Regards,
    Tianyu

    • If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
      Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

0 additional answers

Sort by: Most helpful