IIS Express端口80和443与自定义域只有一些站点从Visual Studio调试时启动

时间:2017-06-07 08:23:32

标签: asp.net visual-studio visual-studio-2015 iis-express

您好我想尝试使用自定义域名在端口80和443上运行iis express。我几乎把所有东西都搞定了但是出于某种原因它在调试时不会启动我的所有网站而且我无法弄清楚原因。

以下是来自applicationhost.config的应用程序池和站点

<applicationPools>  
        <add name="AppAdmin" managedRuntimeVersion="v4.0" managedPipelineMode="Integrated" CLRConfigFile="%IIS_USER_HOME%\config\aspnet.config" autoStart="true" />
        <add name="AppAPI" managedRuntimeVersion="v4.0" managedPipelineMode="Integrated" CLRConfigFile="%IIS_USER_HOME%\config\aspnet.config" autoStart="true" />
        <add name="AppMembers" managedRuntimeVersion="v4.0" managedPipelineMode="Integrated" CLRConfigFile="%IIS_USER_HOME%\config\aspnet.config" autoStart="true" />
        <add name="AppNls" managedRuntimeVersion="v4.0" managedPipelineMode="Integrated" CLRConfigFile="%IIS_USER_HOME%\config\aspnet.config" autoStart="true" />
        <add name="AppEvents" managedRuntimeVersion="v4.0" managedPipelineMode="Integrated" CLRConfigFile="%IIS_USER_HOME%\config\aspnet.config" autoStart="true" />
        <add name="AppUserdata" managedRuntimeVersion="v4.0" managedPipelineMode="Integrated" CLRConfigFile="%IIS_USER_HOME%\config\aspnet.config" autoStart="true" />
        <add name="AppWebhooks" managedRuntimeVersion="v4.0" managedPipelineMode="Integrated" CLRConfigFile="%IIS_USER_HOME%\config\aspnet.config" autoStart="true" />
        <add name="AppWebb" managedRuntimeVersion="v4.0" managedPipelineMode="Integrated" CLRConfigFile="%IIS_USER_HOME%\config\aspnet.config" autoStart="true" />
        <applicationPoolDefaults managedRuntimeLoader="v4.0">
            <processModel />
        </applicationPoolDefaults>

    <sites>
        <site name="AppAdmin" id="3" serverAutoStart="true">
            <application path="/" applicationPool="AppAdmin">
                <virtualDirectory path="/" physicalPath="D:\_projects\_svn\proj\Admin" />
            </application>
            <bindings>
                <binding protocol="http" bindingInformation="*:80:admin.local.se" />
                <binding protocol="https" bindingInformation="*:443:admin.local.se" />
            </bindings>
        </site>
        <site name="AppAPI" id="4" serverAutoStart="true">
            <application path="/" applicationPool="AppAPI">
                <virtualDirectory path="/" physicalPath="D:\_projects\_svn\proj\API" />
            </application>
            <application path="/appdirect" applicationPool="AppAPI">
                <virtualDirectory path="/" physicalPath="D:\_projects\_svn\proj\AppSecondAPI" />
            </application>
            <application path="/magnet" applicationPool="AppAPI">
                <virtualDirectory path="/" physicalPath="D:\_projects\_svn\proj\AppWebAPI" />
            </application>
            <application path="/partner" applicationPool="AppAPI">
                <virtualDirectory path="/" physicalPath="D:\_projects\_svn\proj\AppThridAPI" />
            </application>
            <bindings>
                <binding protocol="http" bindingInformation="*:80:api.local.se" />
                <binding protocol="https" bindingInformation="*:443:api.local.se" />
            </bindings>
        </site>
        <site name="AppMembers" id="5" serverAutoStart="true">
            <application path="/" applicationPool="AppMembers">
                <virtualDirectory path="/" physicalPath="D:\_projects\_svn\proj\Members" />
            </application>
            <application path="/dashboard" applicationPool="AppMembers">
                <virtualDirectory path="/" physicalPath="D:\_projects\_svn\proj\dashboard" />
            </application>
            <application path="/InternalAPIs" applicationPool="AppMembers">
                <virtualDirectory path="/" physicalPath="D:\_projects\_svn\proj\InternalAPIs" />
            </application>
            <application path="/FileArchive" applicationPool="AppMembers">
                <virtualDirectory path="/" physicalPath="D:\_projects\_svn\proj\FileArchive" />
            </application>
            <bindings>
                <binding protocol="http" bindingInformation="*:80:members.local.se" />
                <binding protocol="https" bindingInformation="*:443:members.local.se"/>
            </bindings>
        </site>
        <site name="AppNls" id="6" serverAutoStart="true">
            <application path="/" applicationPool="AppNls">
                <virtualDirectory path="/" physicalPath="D:\_projects\_svn\proj\nls" />
            </application>
            <application path="/trchive" applicationPool="AppNls">
                <virtualDirectory path="/" physicalPath="D:\_projects\_svn\proj\nls\Archive" />
            </application>
            <application path="/cs" applicationPool="AppNls">
                <virtualDirectory path="/" physicalPath="D:\_projects\_svn\proj\nls\cs" />
            </application>
            <application path="/shared" applicationPool="AppNls">
                <virtualDirectory path="/" physicalPath="D:\_projects\_svn\proj\nls\Shared" />
            </application>
            <application path="/thumbnail" applicationPool="AppNls">
                <virtualDirectory path="/" physicalPath="D:\_projects\_svn\proj\nls\Thumbnail" />
            </application>
            <bindings>
                <binding protocol="http" bindingInformation="*:80:nls.local.se" />
                <binding protocol="https" bindingInformation="*:443:nls.local.se" />
            </bindings>
        </site>
        <site name="AppEvents" id="7" serverAutoStart="true">
            <application path="/" applicationPool="AppEvents">
                <virtualDirectory path="/" physicalPath="D:\_projects\_svn\proj\AppEvents" />
            </application>
            <bindings>
                <binding protocol="http" bindingInformation="*:80:appevent.local.se" />
                <binding protocol="https" bindingInformation="*:443:appevent.local.se" />
            </bindings>
        </site>
        <site name="AppWebhooks" id="9" serverAutoStart="true">
            <application path="/" applicationPool="AppWebhooks">
                <virtualDirectory path="/" physicalPath="D:\_projects\_svn\proj\Webhooks" />
            </application>
            <bindings>
                <binding protocol="http" bindingInformation="*:80:webhooks.local.se" />
                <binding protocol="https" bindingInformation="*:443:webhooks.local.se" />
            </bindings>
        </site>
        <site name="AppUserdata" id="8" serverAutoStart="true">
            <application path="/" applicationPool="AppUserdata">
                <virtualDirectory path="/" physicalPath="\\networkpath\folder\UserData" />
            </application>
            <bindings>
                <binding protocol="http" bindingInformation="*:80:userdata.local.se" />
                <binding protocol="https" bindingInformation="*:443:userdata.local.se" />
            </bindings>
        </site>
        <site name="AppWebb" id="12" serverAutoStart="true">
            <application path="/" applicationPool="AppWebb">
                <virtualDirectory path="/" physicalPath="D:\_projects\_svn\proj\AppWebb" />
            </application>
            <bindings>
                <binding protocol="http" bindingInformation="*:80:local.se" />
                <binding protocol="http" bindingInformation="*:80:www.local.se" />
            </bindings>
        </site>
        <siteDefaults>
            <logFile logFormat="W3C" directory="%IIS_USER_HOME%\Logs" />
            <traceFailedRequestsLogging directory="%IIS_USER_HOME%\TraceLogFiles" enabled="true" maxLogFileSizeKB="1024" />
        </siteDefaults>
        <applicationDefaults applicationPool="Clr4IntegratedAppPool" />
        <virtualDirectoryDefaults allowSubDirConfig="true" />

如果我将AppAdmin设置为启动,那么iis express将启动以下网站

  • AppAdmin
  • AppMembers
  • AppNls
  • AppEvents
  • AppWebHooks

所以它不会开始

  • AppApi
  • AppUserData
  • AppWebb

VS或IIS如何表达选择要启动的网站?我无法在* .sln或* .csproj中找到任何可以给我提示的东西。

这就是我为实现这一目标所做的工作。

  • 将域添加到指向127.0.0.1
  • 的hosts文件
  • 我添加了netsh http add urlacl url=*THEURL* user=everyone
  • 的所有网址
  • 我以管理员身份运行VS
  • 我在这里添加了自定义网址 desc

我尝试将AppAdmin和AppApi设置为启动项目,然后IIS Express只给我&#34; Unknow error&#34;从我可以看到nog日志的任何地方。

如果我将启动项目更改为AppWebb,那么它始终是相同的站点,然后这些站点启动AppApi,AppUserData,AppWebb而不是以AppAdmin启动的启动项目。

Verisions and stuff

  • Windows 10
  • Visual Studio 2015
  • 所有项目都是ASP.NET 4.5.1

是否可以运行这样的设置? 这里的任何帮助都会很好,如果有什么不清楚请注释,我会尝试更新问题。

0 个答案:

没有答案