2

I'm trying to get my website deployed by a Jenkins job.

I'm using the following command line sentence, with no success:

"C:\Windows\Microsoft.NET\Framework\v3.5\msbuild.exe" myproj.csproj /p:DeployOnBuild=true

I've also tried:

"C:\Windows\Microsoft.NET\Framework\v3.5\msbuild.exe" myproj.csproj  /p:Configuration=Debug /p:OutputPath="obj\debug" /p:DeployIisAppPath="Default Web Site/demo" 

None works although my project is compiled properly.

WHen I go to C:\inetpub\wwwroot nothing new is there. I want my site to start running and be accesible from my browser in Localhost.

2
  • What error are you receiving? Commented Mar 26, 2016 at 15:02
  • @OğuzhanTopçu please see my extended description. My site is not being copied to inetpub nor visible from the IIS administration panel. Commented Mar 26, 2016 at 15:04

2 Answers 2

2

You can use MSDeploy to deploy your web app using the following MSBuild arguments

/p:Configuration=release
/p:DeployOnBuild=True 
/p:DeployTarget=MSDeployPublish
/p:MsDeployServiceUrl=https://targetServer:8172/MsDeploy.axd
/p:DeployIisAppPath=MySite 
/p:AllowUntrustedCertificate=True
/p:Username=
/p:AuthType=NTLM

MSDeploy, however, has proven to be better solution for us. We use MSBuild to create an MSDeploy package and then we can deploy that package to many environments using MSDeploy.exe. Build once, deploy many. Here is an overview of WebDeploy which may be helpful:

http://dotnetcatch.com/2016/02/25/the-anatomy-of-a-webdeploy-package/

Sign up to request clarification or add additional context in comments.

6 Comments

I have used the following: ...\Microsoft.NET\Framework64\v4.0.30319\MSBuild.exe /t:Package and that generated a package. However my app is for .NET 3.5 (and only using .NET 4's MBUILD seems to generate the package with no errors). May I now deployit for .NET 3.5 ? How? Thanks
BTW, if I use the 3.5 version of MSBUILD it throws: error MSB4057: The target "Package" does not exist in the project.
Yes, you can deploy the package (built via MSBuild 4) to a .NET 3.5 site. Run the *.deploy.cmd file to deploy the package. If you run the .cmd file without any params it will provide help documentation.
It worked, however, I don't see how to deploy for .NET 3.5 when I've used MSBUILT 4...?
MSBuild 4 is backwards compatible with 3.5 projects.
|
1

Make sure that you are adding the correct parameters after the MSBuild command, such as /p:DeployOnBuild=true /p:PublishProfile="XXXProfile", but the most important is to add the MSBuild.exe path to your %PATH% environment variable.

Having the MSBuild.exe path added to your %PATH% system environment variable the only thing you need to do is call: msbuild myproject.csproj /p:DeployOnBuild=true /p:PublishProfile="MyProfile", where MyProfile is the generated publishing profile with Visual Studio and can be found under MyProject\Properties\PublishProfiles folder.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.