Create a web application with a specific location

I am trying to create an IIS web app with a custom location and after reading the documentation I think I cannot do it with createApp alone.

"C:\Program Files\IIS\Microsoft Web Deploy\msdeploy.exe" -verb:sync -source:createApp -dest:createApp="Default Web Site/MyApp",filePath="C:\MyCustomDir"

      

Error: Provider's "createApp" does not support the "filePath" setting. Supported parameters: (managedRuntimeVersion, enable32Bi tAppOnWin64, managedPipelineMode, authType, computername, encryptPassword, includeAcls, password, prefetchPayload, username, wmsvc). Number of errors: 1.

+3


source to share


1 answer


First, as the error message shows, filePath is not a parameter to createApp - it is actually its own provider that can copy individual files (see Web Deploy filePath Provider ).

createApp only creates the web application definition in the IIS configuration (apphost.config file) - it doesn't actually create the folder for the web application. So, you are better off using iisApp , which creates an application definition in IIS and a folder for you.

Following the goals of your example, I tried the following command using iisApp:



msdeploy -verb:sync -source:iisApp="c:\MyCustomDir" -dest:iisapp="Default Web Site/MyApp"

      

The command works, but the problem is that since the application was created on the default website (and using the iisApp and createApp commands, you must have an existing IIS site under which the application will be created), the specified folder in the source has been ignored. Instead, iisApp automatically created a MyApp folder in the default website folder, which in this case was C:\inetpub\wwwroot\MyApp

.

If you want to change the folder for the application elsewhere, it looks like you need to do so after the fact. In IIS Manager, you can do this by selecting MyApp in the Connections pane, clicking Basic Settings in the Action Pane, and then changing the Physical Path in the Edit Application dialog box.

+4


source







All Articles