Search code examples
msbuildaspnet-compiler

MSBuild not always creating .precompiled files


I'm having an issue with my Build server. I'm calling MSBuild for Building a Web Project, the process runs, it even shows ASPNETCOMPILER warnings for some views, the views are getting 'cleaned' but the .precompiled files and DLLs are not getting saved to the bin folder.

Some information: MSBuild version: 16.11.0.36601 (VS 2019 default version), Server: Windows Server 2012 R2 Standard.

This is the command I'm using (works on other machines):

"C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Current\Bin\MSBuild.exe" "[PATH]\Web.sln" /t:Clean;Rebuild /p:Configuration=Release /p:BuildInParallel=true /p:PrecompileBeforePublish=true /p:EnableUpdateable=false /p:DebugSymbols=false /p:DeployOnBuild=true

The main issue is I need MSBuild to generate the files always on every run and it's happening once in a while.

Some other parameters I've used with no success:

/p:OutputPath=bin

/p:UseMerge=true /p:WDPMergeOption="MergeAllOutputsToASingleAssembly" /p:SingleAssemblyName="WebCompiled"

Build instead of Rebuild

I've tried to run the command also with Admin permissions with my Administrator account and the same result.


Solution

  • Not having success in finding the cause of the inconsistent behavior, I had to set up a new server to run the compilation.