【问题标题】:Create web share with C# fails with no errors使用 C# 创建 Web 共享失败且没有错误
【发布时间】:2010-12-08 17:15:25
【问题描述】:

我想在特定文件夹网络共享上创建(在 IIS 上)。 我在日志中没有任何错误,但尚未创建共享(下面的代码)。 在事件查看器中,我看到两个“服务控制管理器”错误

A.万维网发布服务服务意外终止。它已经完成了 2 次。

B. IIS Admin Service 服务意外终止。它已经完成了 2 次。

此代码在其他 3 台机器上运行良好,我怀疑这是环境问题,将不胜感激。

// create a web shared for the audio path
IISVirtualRoot vRoot = new IISVirtualRoot();
string errorOut;
string RootWeb = "IIS://localhost/W3SVC/1/Root";
string inPhysicalDirectory =  Path.Combine(index.TargetDir, "WAVS_" + index.ID);
string VirtualDirectory =  "WAVS_" + index.ID;

vRoot.Create(RootWeb, inPhysicalDirectory, VirtualDirectory, out errorOut);

【问题讨论】:

  • 这是什么IISVirtualRoot 类?你在使用System.EnterpriseServices.Internal 命名空间吗?

标签: c# iis iis-6 event-viewer


【解决方案1】:

是的,我使用 System.EnterpriseServices.Internal

【讨论】:

  • 由于这是对@Kev 评论的回应,因此将其作为评论而不是答案会更合适。
猜你喜欢
  • 2019-07-27
  • 2022-01-02
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2013-01-17
  • 1970-01-01
相关资源
最近更新 更多