1

I am developing an ASP.Net MVC5 application wherein I need to create a PDF. I am using the iText7 nuget package to do so. The code works fine, however when I hit debug after making code changes, it takes a long time (close to 5 min) to build the solution. This doesn't happen if I manually clean or rebuild the solution/project. Why does this happen? Anyway to rectify/improve this? Note:The build option is also set to "Always Build" on debug.

user9057272
  • 367
  • 2
  • 5
  • 17

1 Answers1

1

The code works fine, however when I hit debug after making code changes, it takes a long time (close to 5 min) to build the solution. This doesn't happen if I manually clean or rebuild the solution/project.

This issue may be related to some debugging integration tools, third-party extensions,cache files,etc. Please try my suggestions below:

Suggestion

1) disable option Enable Diagnostic Tools while debugging under Tools-->Options-->Debugging-->General.

If you use VS Enterprise, please disable Enable IntelliTrace under Tools-->Options-->IntelliTrace-->General.

2) clean the component caches under C:\Users\xxxx\AppData\Local\Microsoft\VisualStudio\15.0_xxxxx(15 is VS2017 and 16 is VS2019)\ComponentModelCache and C:\Users\xxxx\AppData\Local\Temp

3) disable any third party extensions under Extensions and Updates or use devenv /safemode to start your VS

4) close VS Instance, delete .vs hidden folder,bin,obj folder under the physical path of the solution and then reopen your project.

5) try to add <MvcBuildViews>false</MvcBuildViews> in xxxx.csproj file. See this.

6) If your VS is not the latest version, please update it to the latest version in case there are some fixes.

In addition, you can set MSBuild project build output verbosity to Diagnostic/Detailed under Tools-->Options-->Projects and Solutions-->Build and Run so that you can see the detailed build log on the output window and with it, you can see where the problem is.

Mr Qian
  • 21,064
  • 1
  • 31
  • 41