We are using Azure Web Services (not Web-sites) and run ASP.Net MVC 5.1 application inside it.
When I publish web-sites through Web-deploy, I have an option to "Precompile during publishing":
When I publish to Azure Web Services, I can't find this option anywhere. Any pointers?
The idea is to pre-compile views, so first hit to a view would not be time-penalised by compiling on the fly.
I've looked on Razor Generator but it does not suit our needs. I've seen few other options, but compiling views at publishing stage makes the most sense for our case.
UPD: Just for my reference, I've tried what David Ebbo suggested and it did not work.
The default (checked) setting of "Allow precompiled site to be updateable" allows you to update your view content without needing to rebuild the entire project.
Performing Precompilation You can precompile a Web site using the Aspnet_compiler.exe tool on the command line. For more information, see How to: Precompile ASP.NET Web Sites for Deployment and ASP.NET Compilation Tool (Aspnet_compiler.exe). Visual Studio also includes commands to precompile a Web site from the IDE.
Calling compiler %windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_compiler.exe -m /LM/W3SVC/1273337584/ROOT
from command line on the Azure server seems to cause compilation. The Temporary ASP.Net root directory contains one directory this increases in-size and number of files contained within. The site then restarts after compilation. First page open performance then seems much better.
If I run this within a startup script it doesn't work as the site isn't avaible. I guess IIS hasn't started up. Looking at doing something like this Azure: How to execute a startup task delayed?
The site ID doesn't seem to change for different deployments. I guess could get the site id out of IIS and then use that it if it does.
So looks like that does it. Is there are more elegant way? Don't understand why compiling and deploying view files is such a chore.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With