7

I'm trying to automate deployment of a site. I started with this article

and everything works great from VS 2010. However, I'm having problems with the command line I use this

c:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe "d:\Projects\test.csproj" /T:Package /P:PackageLocation="d:\Package\packageTest.zip"

to create the package

and

d:\Projects\packageTest.deploy.cmd "-setParam:name='IIS Web Application Name',value=MSBuild/Test2" /y

to get to at least deploy correctly. However, it doesn't take any of the IIS options (the app pool is MSBuild instead of ASP.NET v2.0) and, as I said before, the IIS Web Application Name is wrong. Shouldn't this information be taken from .csproj file? All these settings are done for debug configuration and platform any cpu

2
  • I still don't know what platform msbuild takes, but when I set these changes for all platforms in VS 2010, worked fine. Commented Jul 14, 2010 at 14:43
  • Even without setting IS Web Application Name. This question should be closed Commented Jul 14, 2010 at 14:46

1 Answer 1

6

You typically setup your application on the IIS first, with correct path, application pool and so forth. When setup you can use MSBuild to deploy into that application name like this:

msbuild <your_web_project_name>.csproj /p:Configuration=Release /p:OutputPath=bin /p:DeployOnBuild=True /p:DeployTarget=MSDeployPublish /p:MsDeployServiceUrl=https://<url_to_your_server>:8080/msdeploy.axd /p:username=<username> /p:password=<password> /p:AllowUntrustedCertificate=True /p:DeployIisAppPath=<your_site_name> /p:MSDeployPublishMethod=WMSVC /p:VisualStudioVersion=11.0

If you don't want to setup the site manually, you could run a power shell looking something like this:

Import-Module WebAdministration
New-Item iis:\Sites\<your_site_name> -bindings @{protocol="http";bindingInformation=":80:<your_site_name>} -physicalPath c:\inetpub\wwwroot\<your_site_name>
Set-ItemProperty 'IIS:\Sites\<your_site_name>' ApplicationPool "ASP.NET v4.0"
Sign up to request clarification or add additional context in comments.

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.