views:

968

answers:

2

I am encountering a strange build issue in .NET 3.5. The compiler is crashing when it attempts to build a Web Deployment Project.

C:\Program Files\MSBuild\Microsoft\WebDeployment\v9.0\Microsoft.WebDeployment.targets(531,9): error MSB6006: "aspnet_compiler.exe" exited with code -532459699.

Which leads to:

Could not load file or assembly 'aspnet_compiler, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. Failed to grant permission to execute. (Exception from HRESULT: 0x80131418)

That section of Microsoft.WebDeployment.targets is this:

<AspNetCompiler 
      PhysicalPath="$(_AspNetCompilerSourceWebPath)"
      TargetPath="$(TempBuildDir)"
      VirtualPath="$(_AspNetCompilerVirtualPath)"
      Force="$(_Force)"
      Debug="$(DebugSymbols)"
      Updateable="$(EnableUpdateable)" 
      KeyFile="$(_FullKeyFile)" 
      KeyContainer="$(_AspNetCompilerKeyContainer)"
      DelaySign="$(DelaySign)" 
      AllowPartiallyTrustedCallers="$(AllowPartiallyTrustedCallers)" 
      FixedNames="$(_AspNetCompilerFixedNames)" 
      Clean="$(Clean)"
      MetabasePath="$(_AspNetCompilerMetabasePath)"
/>

If I try:

aspnet_compiler.exe -errorstack -v /MyProject -p C:\MyProject -f -c -d .\TempBuildDir\

I get:

Unhandled Exception: System.IO.FileLoadException: Could not load file or assembly 'aspnet_compiler, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. Failed to grant permission to execute. (Exception from HRESULT: 0x80131418)

File name: 'aspnet_compiler, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' ---> System.Security.XmlSyntaxException: Invalid syntax.

I could build fine until I made a small code change. I've reverted the change, but I continue to encounter this error. Other team members can build the exact same source.

Things I've Tried

  • Reinstalling VS
  • Reinstalling Web Deployment Projects addin
  • Restarting
  • Building with nant
  • Building in VS
  • Building from the command line with aspnet_compiler.exe

Has anyone encountered this type of error before? My next step is to reformat, unless I can find something else to try.

+1  A: 

Try clearing out your [Windows folder]\Microsoft .NET\Framework\2.0xxx\Temporary ASP.NET Files*.* folder - that can sometimes get gummed up with GB's of temp files. Also, check to see if your website is using Impersonation or an alternate security account. If it is, then make sure that you grant write and execute perms for the aforementioned folder to the impersonated account.

Josh E
I forgot about the temp files. I cleared them out and tried again, but it still doesn't build.
EndangeredMassa
have you checked your indentity/impersonation settings? I had a similar issue with a web app once, and it was because I had my site impersonating a low-privileged domain account that didn't have the perms to compile
Josh E
This project uses forms authentication.
EndangeredMassa
A: 

I was finally able to build after running a full build in nant with:

nant build

I thought I tried this before. Anyway, it works now--no thanks to the error message. I imagine that my nant config for MyProject is missing a dependency, or something.

EndangeredMassa