0

I have an ASP.NET Web API service. I have noticed that on Web Publishing Wizard there is an option called "Precompile during publishing". What does this option do? What is the impact by publishing with this option checked or unchecked?

I have googled and found this question. What effect does the new precompile during publishing option have on MVC4 applications?.

There it says:

If you have anything in App_Code, it will be precompiled into a DLL before deployment. Without precompiling, this would happen on the fly by the ASP.NET runtime.

Based on this I understand that If you have things in App_Code it is better to check this option, also I understand that performance increases, right?

There it also says:

If you don't have any files in App_Code and you want your site to remain updateable, it doesn't seem to do much.

Where is App_Code folder? In my ASP.NET Web API REST project I do not have any App_Code folder. Instead I have App_Data (empty) and App_Start folders.

So in my case, as I do not have any App_Code folder, is it better to not check "Precompile during publishing" option?

Yehor Androsov
  • 4,885
  • 2
  • 23
  • 40
Willy
  • 9,848
  • 22
  • 141
  • 284
  • Does this answer your question? [What effect does the new precompile during publishing option have on MVC4 applications?](https://stackoverflow.com/questions/16179519/what-effect-does-the-new-precompile-during-publishing-option-have-on-mvc4-applic) – Neil Dec 04 '20 at 13:57
  • I understand that it also compiles your .cshtml files, which means they will not need to be compiled on the fly whenever they are first accessed. – Neil Dec 04 '20 at 13:57
  • @Neil Well, not at all. What is App_Code folder? I do not have this folder in my ASP.NET Web API service project. I only have App_Data (it is empty) and App_Start folders. So based on that answer could I assume that in my case it is better to uncheck this option in my case (since I do not have App_Code folder)? – Willy Dec 04 '20 at 14:00
  • @Neil In my case is a ASP.NET Web API REST service. It has no UI, so no .cshtml files are in my project. I only have .cs files, global.asax, nuget package.config and web.config files. – Willy Dec 04 '20 at 14:02
  • In your case, perhaps it doesn't do anything extra, so it's probably worth turning off, but I would do some compilation timings to see if it makes any difference. If there are cshtml, it can significantly increase compilation times, but if it makes no/hardly any difference, I'd be tempted to turn it on, just in case there is something other than cshtml that would benefit from the feature – Neil Dec 21 '20 at 09:16

0 Answers0