Nishant
Nishant

Reputation: 633

dotnet publish command not working with asp dotnet project in aws buildspecs.yml file

I have created sample dot net application, folder structure as follows.

enter image description here

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. enter image description here

Now i am using same command dotnet publish -c release -o ./build_output test1.csproj but this not working. Getting the following error.

enter image description here

Any idea why this error?

Upvotes: 0

Views: 2057

Answers (2)

Tolga Cakir
Tolga Cakir

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

mikenlanggio
mikenlanggio

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

Related Questions