Reputation: 633
I have created sample dot net application, folder structure as follows.
When i am using this command
dotnet publish -c release -o ./build_output demorepo2.csproj
build output is getting created inside build_output
folder correctly.
Now i have another asp.net mvc web application.
Now i am using same command dotnet publish -c release -o ./build_output test1.csproj
but this not working. Getting the following error.
Any idea why this error?
Upvotes: 0
Views: 2057
Reputation: 755
Couldn't find Microsoft.WebApplication.targets file in specified path.
You need to find this file in your C: directory and set the path in .csproj file.
For example:
<Import Project="C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Microsoft\VisualStudio\v16.0\WebApplications\Microsoft.WebApplication.targets" Condition="true" />
Upvotes: 0
Reputation: 1137
From ASP.NET Web Deployment using Visual Studio: Command Line Deployment
Try to run this command:
msbuild demorepo2.csproj /p:DeployOnBuild=true /p:PublishProfile=MyPublishProfile
Upvotes: 1