IIS快速部署应用程序

时间:2011-03-28 06:35:22

标签: asp.net iis

我在家里有visual studio 2010,并开发了一个Web应用程序。我现在在另一个位置的另一台计算机上。我所拥有的只是我的USB驱动器上的项目文件夹,所有这台计算机都安装了IIS Express。有什么方法可以让我的Web应用程序启动并运行吗?

2 个答案:

答案 0 :(得分:13)

假设您拥有在项目文件夹中运行Web应用程序所需的所有文件,您应该能够在IIS Express中创建该站点并启动它。

以下是您可能需要添加到IIS Express配置文件的内容。该文件通常位于“C:\ Users \\ Documents \ IISExpress \ config \ applicationhost.config”中。

下面,您需要更改网站的路径,并确保正确绑定到该网站。如果端口号与您要保留的任何其他网站冲突,则可能需要更改端口号。

<sites>
    <site name="MyWebsite" id="1" serverAutoStart="false">
    <application path="/">
        <virtualDirectory path="/" physicalPath="<USB Drive>:\<FolderToMyWebsite>" />
    </application>
    <bindings>
        <binding protocol="http" bindingInformation=":8080:localhost" />
    </bindings>
    </site>
<sites>

答案 1 :(得分:0)

我遇到了同样的问题,我通过以下方式解决了这个问题:

实施例: port = 1111

local_ip_address = 192.168.1.1 - 存储网页的本地网络IP地址

第1步:

netsh http add urlacl url=http://local_ip_address:port/ user=Everyone

第2步:

<bindings>
        <binding protocol="http" bindingInformation="*:port:localhost" />
        <binding protocol="http" bindingInformation="local_ip_address:port:" />
</bindings>

第3步:

netsh advfirewall firewall add rule name="IIS Express (non-SSL)" action=allow protocol=TCP dir=in localport=port

在此处发表评论解决方案: http://blogs.iis.net/vaidyg/archive/2010/07/29/serving-external-traffic-with-webmatrix-beta.aspx