Problem in creation of webapplication within Virtual Directory in IIS

Topics: IIS and Web Services
May 25, 2011 at 6:44 AM

Hi,

I am trying to create Virtual directory in IIS that contains the some web applications. I have used the below script in my .btproj file.

<ItemGroup>
    <VDirList Include="*">
      <Vdir>ServiceManagementFramework.Site</Vdir>
      <Physdir>..\ServiceManagementFramework.Site</Physdir>
      <AppPool>ServiceManagementFramework.Site</AppPool>
    </VDirList>
  </ItemGroup>

 

I am getting the below error

C:\Program Files (x86)\MSBuild\DeploymentFrameworkForBizTalk\5.0\BizTalkDeploymentFramework.targets(1646,5): error MSB4018: The "CreateVirtualDirectory" task failed unexpectedly. [D:\ProjectFramework\Framework\Framework.Deployment\Framework.Deployment.btdfproj]
C:\Program Files (x86)\MSBuild\DeploymentFrameworkForBizTalk\5.0\BizTalkDeploymentFramework.targets(1646,5): error MSB4018: System.Runtime.InteropServices.COMException (0x800700B7): Cannot create a file when that file already exists. (Exception from HRESULT: 0x800700B7) [D:\ProjectFramework\Framework\Framework.Deployment\Framework.Deployment.btdfproj]
C:\Program Files (x86)\MSBuild\DeploymentFrameworkForBizTalk\5.0\BizTalkDeploymentFramework.targets(1646,5): error MSB4018:    at System.DirectoryServices.Interop.UnsafeNativeMethods.IAdsContainer.Create(String className, String relativeName) [D:\ProjectFramework\Framework\Framework.Deployment\Framework.Deployment.btdfproj]
C:\Program Files (x86)\MSBuild\DeploymentFrameworkForBizTalk\5.0\BizTalkDeploymentFramework.targets(1646,5): error MSB4018:    at System.DirectoryServices.DirectoryEntries.Add(String name, String schemaClassName) [D:\ProjectFramework\Framework\Framework.Deployment\Framework.Deployment.btdfproj]
C:\Program Files (x86)\MSBuild\DeploymentFrameworkForBizTalk\5.0\BizTalkDeploymentFramework.targets(1646,5): error MSB4018:    at DeploymentFramework.BuildTasks.CreateVirtualDirectory.Execute() [D:\ProjectFramework\Framework\Framework.Deployment\Framework.Deployment.btdfproj]
C:\Program Files (x86)\MSBuild\DeploymentFrameworkForBizTalk\5.0\BizTalkDeploymentFramework.targets(1646,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() [D:\ProjectFramework\Framework\Framework.Deployment\Framework.Deployment.btdfproj]
C:\Program Files (x86)\MSBuild\DeploymentFrameworkForBizTalk\5.0\BizTalkDeploymentFramework.targets(1646,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask, Boolean& taskResult) [D:\ProjectFramework\Framework\Framework.Deployment\Framework.Deployment.btdfproj]
Done Building Project "D:\ProjectFramework\Framework\Framework.Deployment\Framework.Deployment.btdfproj" (Deploy target(s)) -- FAILED.

Build FAILED.

 

Problem is that, once i have deleted the virtual folder from IIS after that, deployment gives this sort of error.

Also why does undeployment does not remove the Virtual directories from IIS.

May 25, 2011 at 7:01 AM

Part-1

One more issue,i am trying to create web applications with in the virtual directory in IIS but it just creates the web applications in the form of folder and it needs me to manually convert those folders to applications.How could i do it through .btdfproj scripts,do i need to add another VDirList like this

<ItemGroup>
    <VDirList Include="*">
      <Vdir>ServiceManagementFramework.Site</Vdir>
      <Physdir>..\ServiceManagementFramework.Site</Physdir>
      <AppPool>ServiceManagementFramework.Site</AppPool>
    </VDirList>

    <VDirList Include="*">
      <Vdir>framework_outbound_service</Vdir>
      <Physdir>..\ServiceManagementFramework.Site\framework_outbound_service</Physdir>
      <AppPool>ServiceManagementFramework.Site</AppPool>
    </VDirList>
  </ItemGroup>

but this creates creates a separate Web application and not within the ServiceManagementFramework.Site

Please tell me how to do it.

Part-2

How to make the AppPool and the Web applications to make use the user Credentials.Instead of changing it manually in IIS.

Coordinator
May 25, 2011 at 7:17 AM

Hi, I think this topic already covers most of your questions.

By default, virtual directories are removed only on server deployments, not on developer deployments.  That can be overridden with MSBuild property <UndeployIISArtifacts>true</UndeployIISArtifacts>.

The app pool is created and configured on server deployments, not on developer deployments.  In general, developer deployments tend to assume that you're doing dev work with the web services/components, so as the developer you've probably set up a vdir and AppPool the way that you want it and don't need the BTDF messing around with it.  On servers, it assumes that nothing is set up.

Also remember that you must install all of the optional IIS 6 backward compatibility features on Windows 7/Vista/Server 2008 for the BTDF IIS deployment to work properly.

Thanks,
Tom

May 25, 2011 at 7:48 AM

thanks Tom.

But tell me how do i create the Web application within the virtual directory.

Coordinator
May 25, 2011 at 7:54 AM

Please try this on a server deployment (i.e. use the MSI to install then deploy, even if it's on your own machine) and see if that takes care of it for you.  The InstallWizard.xml found in the Advanced sample application is a good reference when deploying to IIS -- it includes two properties that are collected during the server deploy wizard UI and are used to configure the AppPool identity (VDIR_UserName and VDIR_UserPass).

Thanks,
Tom