Microsoft.Web.Administration.dll是可再发行的吗? [英] Is Microsoft.Web.Administration.dll Redistributable?

查看:140
本文介绍了Microsoft.Web.Administration.dll是可再发行的吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们使用客户机器中IIS的ServerManager类访问默认端口号。但是控制台没有运行某些机器并显示需要Microsoft.Web.Administration.dll。这个程序集是Redistributable吗?或者有没有其他方法来获取默认端口号?
我使用下面的代码来获取端口号。

We are accessing default port number using ServerManager class from IIS in customer machines. But the Console didn’t run some of the machines and show Microsoft.Web.Administration.dll is required. Is this assembly is Redistributable? Or Is there any other way to get the default Port number? I am using below code to get the Port Number.

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;
                        }
                    }
                }
            }
        }

请帮我解决这个问题。

Please help me to solve this issue.

推荐答案

不,它不可重新启动,它应该安装在带有IIS的机器上。即使你这样做,也有可能它不起作用,因为它依赖于需要存在和注册的其他库(本机代码DLL)。

No, it is not redistrbutable, it should be installed in the machine with IIS. Even if you did, the likelihood is it will not work since it has dependencies on other libraries (native code DLLs) that need to exist and be registered.

这篇关于Microsoft.Web.Administration.dll是可再发行的吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆