Jeff Dege
Jeff Dege

Reputation: 11680

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:

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?

Upvotes: 3

Views: 4259

Answers (3)

Patrick
Patrick

Reputation: 11

I was getting this error when I tried to publish. What worked for me was un-selecting "PreCompile during publishing." The setting is in the Publish Profile.

Upvotes: 1

Brad Boyce
Brad Boyce

Reputation: 1258

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.

Upvotes: 1

Brian E. Langston
Brian E. Langston

Reputation: 106

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

Upvotes: 9

Related Questions