@@ -28,6 +28,7 @@ public class IISDeployer : IISDeployerBase
2828 private string _configPath ;
2929 private string _applicationHostConfig ;
3030 private string _debugLogFile ;
31+ private string _appPoolName ;
3132 private bool _disposed ;
3233
3334 public Process HostProcess { get ; set ; }
@@ -109,6 +110,8 @@ public override Task<DeploymentResult> DeployAsync()
109110 var uri = TestUriHelper . BuildTestUri ( ServerType . IIS , DeploymentParameters . ApplicationBaseUriHint ) ;
110111 StartIIS ( uri , contentRoot ) ;
111112
113+ IISDeploymentParameters . ServerConfigLocation = Path . Combine ( @"C:\inetpub\temp\apppools" , _appPoolName , $ "{ _appPoolName } .config") ;
114+
112115 // Warm up time for IIS setup.
113116 Logger . LogInformation ( "Successfully finished IIS application directory setup." ) ;
114117 return Task . FromResult < DeploymentResult > ( new IISDeploymentResult (
@@ -117,7 +120,8 @@ public override Task<DeploymentResult> DeployAsync()
117120 applicationBaseUri : uri . ToString ( ) ,
118121 contentRoot : contentRoot ,
119122 hostShutdownToken : _hostShutdownToken . Token ,
120- hostProcess : HostProcess
123+ hostProcess : HostProcess ,
124+ appPoolName : _appPoolName
121125 ) ) ;
122126 }
123127 }
@@ -239,13 +243,16 @@ private void WaitUntilSiteStarted(string contentRoot)
239243 RetryServerManagerAction ( serverManager =>
240244 {
241245 var site = FindSite ( serverManager , contentRoot ) ;
246+ IISDeploymentParameters . SiteName = site . Name ;
247+
242248 if ( site == null )
243249 {
244250 PreserveConfigFiles ( "nositetostart" ) ;
245251 throw new InvalidOperationException ( $ "Can't find site for: { contentRoot } to start.") ;
246252 }
247253
248254 var appPool = serverManager . ApplicationPools . Single ( ) ;
255+ _appPoolName = appPool . Name ;
249256 if ( appPool . State != ObjectState . Started && appPool . State != ObjectState . Starting )
250257 {
251258 var state = appPool . Start ( ) ;
@@ -500,7 +507,7 @@ private void RetryServerManagerAction(Action<ServerManager> action)
500507
501508 private void PreserveConfigFiles ( string fileNamePrefix )
502509 {
503- HelixHelper . PreserveFile ( Path . Combine ( DeploymentParameters . PublishedApplicationRootPath , "web.config" ) , fileNamePrefix + ".web.config" ) ;
510+ HelixHelper . PreserveFile ( Path . Combine ( DeploymentParameters . PublishedApplicationRootPath , "web.config" ) , fileNamePrefix + ".web.config" ) ;
504511 HelixHelper . PreserveFile ( Path . Combine ( _configPath , "applicationHost.config" ) , fileNamePrefix + ".applicationHost.config" ) ;
505512 HelixHelper . PreserveFile ( Path . Combine ( Environment . SystemDirectory , @"inetsrv\config\ApplicationHost.config" ) , fileNamePrefix + ".inetsrv.applicationHost.config" ) ;
506513 HelixHelper . PreserveFile ( Path . Combine ( Environment . SystemDirectory , @"inetsrv\config\redirection.config" ) , fileNamePrefix + ".inetsrv.redirection.config" ) ;
0 commit comments