我想在特定文件夹上创建Web共享(在IIS上)。 我没有在日志中有任何错误但是没有创建共享(下面的代码)。 在事件查看器中,我看到两个“服务控制管理器”错误
一个。万维网发布服务服务意外终止。它完成了这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);
答案 0 :(得分:0)
是的,我使用System.EnterpriseServices.Internal