How do you specify the deployIisAppPath to a site root that is not DefaultWebSite?

10,625

Figured this one out.

The problem stemmed from two settings in the Web Deploy page of the project properties. I had previously set this project up (in the Debug configuration) to copy only the files necessary to run the application, and NOT build a zip package. I neglected however to do anything to those settings for the release configuration.

The reason (confidence level 75%) it was trying to use createApp was because it was deploying from the Zip package it had created. So my IISAppPath settings in those cases were fine, I was just deploying the wrong thing.

I set the Create deployment package as a zip file setting to false, and the Items to deploy dropdown to Only files needed to run this application and everything went off without a hitch.

Incidentally I found out (as referred above) that you can use the Publish Profiles outputted by the Web Publish dialog in Visual Studio (2012 only unfortunately; 2010 you have to do some massaging that I am unsure of). I named mine with no spaces, and supplied the password as an argument as well as the Untrusted Certificate setting. Now MSBuild Arguments in the build definition for TFS look like this: /p:DeployOnBuild=True;PublishProfile=NameOfPublishProfile /p:AllowUntrustedCertificate=True /p:Password=PleaseVerifyMe

Share:
10,625
CodeWarrior
Author by

CodeWarrior

I am a software engineer working on Azure, ASP.NET MVC and WebAPI projects as well as JS/Angular/React web applications. When I am not writing software, I am playing video games (Factorio, RimWorld), making Root Beer out of honey harvested from our bee hives, and fixing my small fleet of Jeep Liberty SUVs.

Updated on July 20, 2022

Comments

  • CodeWarrior
    CodeWarrior almost 2 years

    I have a ASP.NET MVC web application project that I want to deploy to my IIS webserver. The site tree is set up thusly:

    SERVERNAME(myDomain\Username)
       Application Pools
       Sites
          Default Web Site
          MyProjectSite
             bin
             Content
             ...
             Views
    

    I am trying to deploy to the MyProject site. See below settings that I am using versus the errors I am returning. I am apparently not specifying my site path correctly, but for the life of me, I can't figure out what it should be.

    The following settings stay the same between iterations:

    /p:DeployOnBuild=True /p:DeployTarget=MsDeployPublish /p:CreatePackageOnPublish=False /p:MSDeployPublishMethod=WMSvc /p:AuthType=Basic /p:Username="myUserName" /p:Password="MyPassword" /p:AllowUntrustedCertificate=True

    Specify SiteName/ as IISAppPath:

    Parameters:

    /p:MsDeployServiceUrl="https://serverName:8172/MsDeploy.axd?Site=MyProjectSite" /p:DeployIisAppPath="MyProjectSite/"

    Error:

    Could not complete an operation with the specified provider ("createApp") when connecting using the Web Management Service - I don't want to create a new site. I want to sync the content that is already there.

    Specify IISAppPath as Root (supposing that the sitename in the URL is used)

    Parameters:

    /p:MsDeployServiceUrl="https://serverName:8172/MsDeploy.axd?Site=MyProjectSite" /p:DeployIisAppPath="/"

    Error:

    Could not complete an operation with the specified provider ("iisApp") when connecting using the Web Management Service - Looks like it is trying to access the Default WebSite or something (to which I have purposefully NOT given myself rights).

    Specify IISAppPath as empty string(supposing that the sitename in the URL is used)

    Parameters:

    /p:MsDeployServiceUrl="https://serverName:8172/MsDeploy.axd?Site=MyProjectSite" /p:DeployIisAppPath=""

    Error:

    The "ConcatFullServiceUrlWithSiteName" task was not given a value for the required parameter "SiteAppName" - So it interprets "" as actually a null value thus breaking an attempt to concatenate it.

    Specify no site attribute in the URL but SiteName/ as IISAppPath

    Parameters:

    /p:MsDeployServiceUrl="https://serverName:8172/MsDeploy.axd" /p:DeployIisAppPath="MyProjectSite/"

    Error:

    Could not complete an operation with the specified provider ("createApp") when connecting using the Web Management Service

    Specify no site attribute in URL but SiteName as IISAppPath

    Parameters:

    /p:MsDeployServiceUrl="https://serverName:8172/MsDeploy.axd" /p:DeployIisAppPath="MyProjectSite"

    Error:

    Could not complete an operation with the specified provider ("createApp") when connecting using the Web Management Service

    Now given that it is running a concatenate on the SiteAppName, it must be combining it with the Site name, yes? What are you supposed to put there to get the site to sync to the root of a site?

    Update

    In an attempt to figure out the proper path scheme, I have tried to publish using the Visual Studio 2012 Publish dialog. In this case, I am returned an error saying that The request timed out (testing the connection works almost instantly and previewing the changes works but takes a few seconds). I checked the event log, and the tracelog for wmsvc to no avail. Even with trace set to verbose, nothing shows up in the tracelog. I have tried disabling the firewalls on both computers, and nothing seems to work on that front either.

  • Isantipov
    Isantipov about 11 years
    congratulations! Did you figure out why it worked OK for the other servers?
  • CodeWarrior
    CodeWarrior about 11 years
    Yup. I was using the Debug configuration. That one was actually set up correctly to deploy (i.e. Only Files to Run the Application and NOT create a zip for publish). Thanks for your help!
  • FlyingMaverick
    FlyingMaverick about 11 years
    What about getting it to work with Visual Studio 2012, where they removed the ZIP option.
  • CodeWarrior
    CodeWarrior almost 11 years
    Hmm... I am almost positive that the Zip File setting was in the Package/Publish Web page of the Properties, but I don't see it there. Was it removed in one of the updates? All of the above was in VS 2012.
  • JMD
    JMD almost 11 years
    /P:CreatePackageOnPublish=True ... causes my script to create the .zip file. +1 for /p:PublishProfile={profileName} ... that's what I was missing with VS2012.
  • JMD
    JMD almost 11 years
    And so far, for my dev server build and deployment, I've got it down to: msbuild HelloWorld.csproj /P:Configuration=Debug /P:DeployOnBuild=True /P:PublishProfile=HelloWorldDebug /P:AllowUntrustedCertificate=True /P:UserName=buildserverusername /P:Password=buildserveruserpass
  • CodeWarrior
    CodeWarrior almost 11 years
    @JMD Yeah, I ended up removing CreatePackageOnPublish as that was not what I wanted. I think this whole thing would be better if Microsoft put out better documentation or a cookbook or something. Maybe one day I will write something up based on my experiences.
  • JMD
    JMD almost 11 years
    I've found this 5-part walk-through to be invaluable. It's written for VS2010 so it doesn't take /p:PublishProfile=x into account, but it's very good otherwise: troyhunt.com/2010/11/you-deploying-it-wrong-teamcity.html
  • MADCookie
    MADCookie about 10 years
    @CodeWarrior, I'm having a similar issue, but my error is "ERROR_SITE_DOES_NOT_EXIST". I'm very concerned that I am not supplying the correct DeployIisAppPath value. Can you confirm for me, that you used the IIS Site name? So you expanded "Sites" and the name you saw there is the value DeployIisAppPath wants?? I'm about to make an official question on SO.
  • MADCookie
    MADCookie about 10 years
    I wrote my question up in SO if you want to help answer it. stackoverflow.com/questions/22233496/…