Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 368
Jeff Dege Avatar asked Jan 01 '26 21:01

Jeff Dege


2 Answers

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

like image 129
Brian E. Langston Avatar answered Jan 04 '26 21:01

Brian E. Langston


I know that windows Azure is not mentioned in the OP, but I ran into this problem too trying to publish to Azure. This question came up in my search for an answer, so I'm posting here so maybe it will help someone else in my position.

What worked for me was to download the publish profile (again) and then redeploy. After that, publish worked fine.

like image 45
Brad Boyce Avatar answered Jan 04 '26 22:01

Brad Boyce



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!