是否Microsoft.Web.Administration.dll可再发行?
问题描述:
我们在客户机器上使用IIS中的ServerManager类访问默认端口号。但控制台没有运行一些机器,并显示Microsoft.Web.Administration.dll是必需的。这个组件是可重新分发的吗?还有其他方法可以获得默认的端口号吗? 我正在使用下面的代码来获取端口号。是否Microsoft.Web.Administration.dll可再发行?
using (ServerManager serverManager = new ServerManager())
{
SiteCollection allsites = serverManager.Sites;
foreach (Site site in allsites)
{
if (site.Name == "Default Web Site")
{
BindingCollection allBindings = site.Bindings;
foreach (Binding bind in allBindings)
{
if (bind.Protocol == "http")
{
PortNo = bind.BindingInformation.ToString();
int portNoLenth = PortNo.Length; PortNo = PortNo.Substring(2, portNoLenth - 3); break;
}
}
}
}
}
请帮我解决这个问题。
答
不,它不是可重定义的,它应该安装在带IIS的机器上。即使你这样做了,它也可能不起作用,因为它依赖于需要存在并被注册的其他库(本地代码DLL)。
+0
感谢您的回答。我已创建另一个控制台与此代码并调用控制台如果IIS安装在客户机中。它帮助我解决它 – Vinoth 2012-05-11 12:26:21
信息的redistributale部分:http://objectmix.com/inetserver/727643-microsoft-web-administration-dll.html – 2012-04-20 14:53:23