We are using Windows Azure
to host our application on a Cloud Service
and use Powershell
to build and package the website using msbuild
.
On releasing our first response time is very slow so naturally we'd need to precompile the application.
There's plenty of documentation for Precompiling using the aspnet_compiler, however I cannot find any official documentation on using:
msbuild Web.sln /p:PrecompileBeforePublish=true
A Google search targeted at MSDN gives me nothing whilst usually MSDN is fairly thorough. All I can see is a useful Stack post from earlier this year.
So does anyone know of any formal documentation for PrecompileBeforePublish
? Am I looking at the wrong source?
Failing that, what exactly does the flag provide us, is it the same as Precompilation for Deployment with an Updatable UI
(reference)?
To run MSBuild at a command prompt, pass a project file to MSBuild.exe, together with the appropriate command-line options. Command-line options let you set properties, execute specific targets, and set other options that control the build process.
It's been a while since this question was posted and there is still no good answer. Recently I wanted to change the way MSBuild runs aspnet_compiler.exe but found no documentation. I did a bit of digging around and here is my experience.
Precompiling will only happen if you use both the DeployOnBuild
and PrecompileBeforePublish
parameters. Other usable parameters are EnableUpdateable
and UseFixedNames
.
msbuild Web.sln /p:DeployOnBuild=true /p:PrecompileBeforePublish=true /p:EnableUpdateable=false /p:UseFixedNames=true
You can achieve a similar result if you change precompile options in Visual Studio. This can be done at Project > Publish > Configure > Settings > File Publish Options > Precompile during publishing > Configure
.
link to image
This is how the parameters should appear in your .pubxml file:
<PrecompileBeforePublish>True</PrecompileBeforePublish>
<EnableUpdateable>False</EnableUpdateable>
<DebugSymbols>True</DebugSymbols>
<WDPMergeOption>CreateSeparateAssembly</WDPMergeOption>
<UseFixedNames>True</UseFixedNames>
Since there is no documentation to be found you might want to change these options and see the resulting .pubxml file to see what further parameters to use in the command line.
I think, your problem is not pre-compilation and I see, you have done precompiling well.
I think your project is too big (Check your final bin directory size) IIS read every dll, and debug symbols and load them in to memory before running any line of code.
If your project size too big, and your virtual environment resorces are low, magnetic disk, low ram, low cpu, so there is no magic in it.
Recommendations:
Regards...
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