-1

Tring to build asp.net web application using MSbuild. Build getting successful but in build_output folder only DLLs are present. When i do publish from visual studio I get a different output which i can deploy to IIS. But MSBUILD gives different output. I want same output as publish from visual studio.

The command I am using:

msbuild ASPWebApp.sln /t:Build /p:DeployOnBuild=true /p:Configuration=Release /p:outdir=.\build_output

Nishant
  • 613
  • 3
  • 9
  • 21

1 Answers1

0

Web application builds use a different target. Try the "/t:WebPublish" target.

/t:WebPublish /p:WebPublishMethod=FileSystem /p:PublishUrl="c:\build\output"
Khoa
  • 84
  • 1
  • 2
  • Updated command as per your suggestion .`msbuild ASPWebApp/ASPWebApp.csproj /p:Configuration=Release /t:WebPublish /p:WebPublishMethod=FileSystem /p:publishUrl=.\output`. Getting error `The target "WebPublish" does not exist in the project` – Nishant Jun 01 '20 at 14:09
  • 1
    Check out this answer [9169341](https://stackoverflow.com/questions/9169341/how-to-use-msbuild-msdeploypublish-to-target-local-file-system) – Khoa Jun 01 '20 at 14:51