Search code examples
visual-studio-2013aspnet-compiler

Can't find the valid AspnetCompilerPath


I have a web application that's failing to publish, from the command line.

It's a VS2013 web application project, with a publish profile defined:

  • Publish method: File System
  • Configuration: Release
  • File Publish Options:
    • Delete all existing files prior to publish
    • Precompile during publishing

When I publish from within the IDE, everything works fine.

When I publish from the command line:

msbuild myapp.sln /property:Configuration=Release /p:DeployOnBuild=true /p:PublishProfile=myapp

I get errors:

C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\Web\Transform\Microsoft.Web.Publishing.AspNetCompileMerge.targets(411,5): 
error : Can't find the valid AspnetCompilerPath [E:\dev\korweb_ws\trunk\korweb_ws\korweb_ws.csproj]

Any ideas as to what might be going on?


Solution

  • I know your question has been open for over a month - hoping you were able to solve it by now. If not, I hope this helps.

    Try setting the "AspnetCompilerPath" value on the command line to the absolute path to the appropriate .NET framework folder. For example, for 64-bit .NET 4, the path might be like this:

    /p:AspnetCompilerPath="C:\windows\Microsoft.NET\Framework64\v4.0.30319"
    

    That's what worked for me, when I had a similar issue.

    -Brian