Could not find a valid AspnetCompilerPath
I have a web application that cannot publish from the command line.
This is a VS2013 Web Application project with a specific publish profile:
- Publishing Method: File System
- Configuration: release
- File publishing options:
-
- Delete all existing files before publishing
-
- Pre-compilation on publication
When I publish to the IDE everything works fine.
When I post from the command line:
msbuild myapp.sln /property:Configuration=Release /p:DeployOnBuild=true /p:PublishProfile=myapp
I am getting 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?
I know your question has been open for over a month - hoping that you were able to resolve it. If not, I hope this helps.
Try setting the "AspnetCompilerPath" value on the command line to the absolute path to the corresponding .NET framework folder. For example, for 64-bit .NET 4, the path might look like this:
/p:AspnetCompilerPath="C:\windows\Microsoft.NET\Framework64\v4.0.30319"
What worked for me when I had a similar problem.
-Brian
I know Azure windows is not mentioned in the OP, but I ran into this issue trying too hard to publish to Azure. This question popped up in my search for an answer, so I am posting here, so maybe it will help someone else in my position.
What worked for me was loading the publish profile (again) and then redeploying. Posting worked fine after that.
I was getting this error when I tried to post it. What worked for me was that there was no "PreCompile at post time" selection. The setting is in the publish profile.