【发布时间】:2020-10-27 14:34:43
【问题描述】:
我正在使用 InPlaceHostingManager 类来集成清单文件,以便在 IIS 中托管应用程序后进行一些单击,我正在尝试获取版本号。见下面的代码
try
{
iphm = new InPlaceHostingManager(new Uri(deployManifestUriStr), false);
iphm.GetManifestCompleted += new EventHandler<GetManifestCompletedEventArgs>(iphm_GetManifestCompleted);
iphm.GetManifestAsync();
}
catch (UriFormatException uriEx)
{
this._logger.Fatal(uriEx, $"Unable to load Applicaition Versions (Invalid Uri) for uri : {deployManifestUriStr}");
}
catch (PlatformNotSupportedException platformEx)
{
this._logger.Fatal(platformEx, $"Unable to load Applicaition Versions (Platform Not Supported Exception) for uri : {deployManifestUriStr}");
}
catch (ArgumentException argumentEx)
{
this._logger.Fatal(argumentEx, $"Unable to load Applicaition Versions (Argument Exception) for uri : {deployManifestUriStr}");
}
catch (UnauthorizedAccessException ex)
{
this._logger.Fatal(ex);
this._logger.Fatal(ex.InnerException);
this._logger.Fatal(ex, $"Unable to load Applicaition Versions (Unauthorized Access Exception) for uri: {deployManifestUriStr}");
}
catch (Exception ex)
{
this._logger.Fatal(ex, $"Unable to load Applicaition Versions (Exception) for uri : {deployManifestUriStr}");
}
我收到以下错误
System.UnauthorizedAccessException:对路径“部署”的访问被拒绝。 在 System.IO.__Error.WinIOError(Int32 错误代码,字符串可能全路径) 在 System.IO.Directory.InternalCreateDirectory(字符串 fullPath,字符串路径,对象 dirSecurityObj,布尔检查主机) 在 System.IO.Directory.InternalCreateDirectoryHelper(字符串路径,布尔检查主机) 在 System.Deployment.Application.SubscriptionStore..ctor(字符串 deployPath,字符串 tempPath,ComponentStoreType 存储类型) 在 System.Deployment.Application.SubscriptionStore.get_CurrentUser() 在 System.Deployment.Application.DeploymentManager..ctor(Uri 部署源,布尔 isUpdate,布尔 isConfirmed,DownloadOptions 下载选项,AsyncOperation optionalAsyncOp) 在 System.Deployment.Application.InPlaceHostingManager..ctor(Uri 部署清单,布尔 launchInHostProcess) 在 Logging.ApplicaitionVersionManifestHelper.Read(String deployManifestUriStr) 中
应用程序池作为网络服务运行。有谁知道部署文件夹在哪里?
【问题讨论】: