Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does aspnet_compiler need write access to the Temporary ASP.NET Files folder on my build server?

We use a CI server (Jenkins) to compile an ASP.NET project and deploy to our web servers.

I want to precompile the site before deployment to increase performance, so I've set the PrecompileBeforePublish property in the Publish Profile (.pubxml).

However, when Jenkins runs the build, the AspNetPreCompile task fails with the error:

AspNetPreCompile:
C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_compiler.exe
-v /
-p c:\jenkins\workspace\DeployJob\MyProject\obj\Release\AspnetCompileMerge\Source
-c
c:\jenkins\workspace\DeployJob\MyProject\obj\Release\AspnetCompileMerge\TempBuildDir

ASPNETCOMPILER : error ASPRUNTIME: The current identity (JenkinsUser) does not have write access to 'C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files'.

Note that this is not the machine where the web site will be deployed to, it is just a build server. I could grant the current identity (JenkinsUser) access to the Temporary ASP.NET Files folder, but I'd rather not have to mess around with filesystem permissions on a box that is just acting as a dumb Jenkins slave.

Is there any way around this? Why is aspnet_compiler trying to write the site to the Temporary ASP.NET Files folder, and is there any way to make it use a different temporary directory instead, such as %TEMP%?

like image 876
Brant Bobby Avatar asked Oct 02 '22 14:10

Brant Bobby


1 Answers

I guess you could play around with this:

  <AspNetCompiler ToolPath="C:\Windows\Microsoft.NET\Framework\v2.0.50727"  VirtualPath="temp"  PhysicalPath="$(ProjectDir)\..\Web" /> 

But you're gonna have to give ~some directory the rights.

It's just one of those "live with it" things.........my instructions document for setting up a CI machine has the "give rights to asp.net directory" as you explain.

like image 61
granadaCoder Avatar answered Oct 13 '22 10:10

granadaCoder