Asp.net 如何在IIS 7.5上获得angular.js文件以部署angular完整堆栈

Asp.net 如何在IIS 7.5上获得angular.js文件以部署angular完整堆栈,asp.net,angularjs,iis,web-config,Asp.net,Angularjs,Iis,Web Config,--更新 现在我得到这个错误,但重写看起来像它的工作,但它读js文件像html或类似的问题 我想为IIS 7.5上的web.config创建正确的重写规则,用于angular full stack application deploy 这是我正在使用的WEB.CONFIG,但我无法配置虚拟路径 <?xml version="1.0" encoding="utf-8"?> <configuration> <system.webServer> <

--更新

现在我得到这个错误,但重写看起来像它的工作,但它读js文件像html或类似的问题

我想为IIS 7.5上的web.config创建正确的重写规则,用于angular full stack application deploy

这是我正在使用的WEB.CONFIG,但我无法配置虚拟路径

<?xml version="1.0" encoding="utf-8"?>
<configuration>

<system.webServer>
    <handlers>
        <add name="iisnode" path="server.js" verb="*" modules="iisnode"/>
    </handlers>
    <iisnode node_env="PRODUCTION"
     nodeProcessCountPerApplication="1"
     maxConcurrentRequestsPerProcess="1024"
     maxNamedPipeConnectionRetry="100"
     namedPipeConnectionRetryDelay="250"
     maxNamedPipeConnectionPoolSize="512"
     maxNamedPipePooledConnectionAge="30000"
     asyncCompletionThreadCount="0"
     initialRequestBufferSize="4096"
     maxRequestBufferSize="65536"
     uncFileChangesPollingInterval="5000"
     gracefulShutdownTimeout="60000"
     loggingEnabled="true"
     logDirectory="iisnode"
     debuggingEnabled="true"
     debugHeaderEnabled="false"
     debuggerPortRange="5058-6058"
     debuggerPathSegment="debug"
     maxLogFileSizeInKB="128"
     maxTotalLogFileSizeInKB="1024"
     maxLogFiles="20"
     devErrorsEnabled="true"
     flushResponse="false"
     enableXFF="false"
     promoteServerVars=""
     configOverrides="iisnode.yml"
     watchedFiles="web.config;*.js" />
    <rewrite>
        <rules>
            <!-- Don't interfere with requests for node-inspector debugging -->
            <rule name="NodeInspector" patternSyntax="ECMAScript" stopProcessing="true">
                <match url="^server.js\/debug[\/]?"/>
            </rule>

            <!-- serve static files from /public folder -->
            <rule name="StaticContent">
                <action type="Rewrite" url="public/{R:0}" logRewrittenUrl="true"/>
                <conditions>
                    <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true"/>
                </conditions>
                <match url="public/*"/>
            </rule>

            <!-- All other URLs are mapped to the Node.js application entry point -->
            <rule name="DynamicContent">
                <conditions>
                    <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="True"/>
                </conditions>
                <action type="Rewrite" url="server.js"/>
            </rule>
            <rule name="SocketIO" patternSyntax="ECMAScript">
                <match url="socket.io.+"/>
                <action type="Rewrite" url="server.js"/>
            </rule>
        </rules>
    </rewrite>
    <!-- <appSettings>
        <add key="virtualDirPath" value="/idetikmssql"/>
    </appSettings> -->

</system.webServer>
这是我的INDEX.HTML

          <!doctype html>
          <!--[if lt IE 7]>      <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
          <!--[if IE 7]>         <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
          <!--[if IE 8]>         <html class="no-js lt-ie9"> <![endif]-->
          <!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
            <head>
              <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon"/>
            <!-- <base href="/"> -->
            <title></title>
            <meta name="description" content="">
            <meta name="viewport" content="width=device-width">
            </head>
            <body ng-app="idetikApp">
            <div ng-view=""></div>
            </body>
            <script type="text/javascript" src="app/app.js"></script>
            <script type="text/javascript" src="bower_components/angular/angular.js"></script>
            <script type="text/javascript" src="bower_components/angular-route/angular-route.js"></script>
            <script type="text/javascript" src="bower_components/angular-resource/angular-resource.js"></script>
          </html>

我将我的文件结构添加到IIS中

--我的解决方案之一

我尝试从头开始安装一个express应用程序,它可以正常工作。我所要做的就是更改process.env.port的端口号及其运行,但是整个堆栈仍然无法正常工作,但我仍然需要帮助

在这里,我的应用程序在IIS上运行良好


好的,伙计们,经过一周的挖掘,我终于让它工作了,以下是IIS 7.5的正确配置记住你的/partials文件夹必须在client/public文件夹中,快速路由才能正常工作

这里有一个链接到

链接:

这是我的web.config

          <?xml version="1.0" encoding="utf-8"?>
    <configuration>
        <system.webServer>
            <handlers>
                <add name="iisnode" path="server.js" verb="*" modules="iisnode"/>
            </handlers>
            <iisnode node_env="PRODUCTION"
             nodeProcessCountPerApplication="1"
             maxConcurrentRequestsPerProcess="1024"
             maxNamedPipeConnectionRetry="100"
             namedPipeConnectionRetryDelay="250"
             maxNamedPipeConnectionPoolSize="512"
             maxNamedPipePooledConnectionAge="30000"
             asyncCompletionThreadCount="0"
             initialRequestBufferSize="4096"
             maxRequestBufferSize="65536"
             uncFileChangesPollingInterval="5000"
             gracefulShutdownTimeout="60000"
             loggingEnabled="true"
             logDirectory="iisnode"
             debuggingEnabled="true"
             debugHeaderEnabled="false"
             debuggerPortRange="5058-6058"
             debuggerPathSegment="debug"
             maxLogFileSizeInKB="128"
             maxTotalLogFileSizeInKB="1024"
             maxLogFiles="20"
             devErrorsEnabled="true"
             flushResponse="false"
             enableXFF="false"
             promoteServerVars=""
             configOverrides="iisnode.yml"
             watchedFiles="web.config;*.js" />
            <rewrite>
                <rules>
                    <!-- Don't interfere with requests for node-inspector debugging -->
                    <rule name="NodeInspector" patternSyntax="ECMAScript" stopProcessing="true">
                        <match url="^server.js\/debug[\/]?"/>
                    </rule>
                    <!-- serve static files from /public folder -->
                    <rule name="StaticContent">
                        <action type="Rewrite" url="public/{R:0}" logRewrittenUrl="true"/>
                        <conditions>
                            <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true"/>
                        </conditions>
                        <match url=".*" />
                    </rule>
                    <rule name="DynamicContent">
                        <conditions>
                            <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="True"/>
                        </conditions>
                        <action type="Rewrite" url="server.js"/>
                    </rule>
                    <rule name="SocketIO" patternSyntax="ECMAScript">
                        <match url="socket.io.+"/>
                        <action type="Rewrite" url="server.js"/>
                    </rule>
                </rules>
            </rewrite>
        </system.webServer>
    </configuration>
index.html

    <!doctype html>
<!--[if lt IE 7]>      <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]>         <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]>         <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
  <head>
    <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon"/>
  <!-- <base href="/node/idetikmssql/"> -->
  <title></title>
  <meta name="description" content="">
  <meta name="viewport" content="width=device-width">
  </head>
  <body ng-app="idetikApp">
  <div ng-view=""></div>
  </body>
  <script type="text/javascript" src="bower_components/angular/angular.js"></script>
  <script type="text/javascript" src="bower_components/angular-route/angular-route.js"></script>
  <script type="text/javascript" src="bower_components/angular-resource/angular-resource.js"></script>
  <script type="text/javascript" src="app/app.js"></script>
</html>
ythemain.html

<h1>this is a partial</h1>
<h2>{{mayvar}}</h2>
这是一个局部错误
{{mayvar}}
最后是文件结构的文件路径和服务器IIS配置

服务器配置


好的,伙计们,经过一周的挖掘,我终于让它工作了,以下是IIS 7.5的正确配置记住你的/partials文件夹必须在client/public文件夹中,快速路由才能正常工作

这里有一个链接到

链接:

这是我的web.config

          <?xml version="1.0" encoding="utf-8"?>
    <configuration>
        <system.webServer>
            <handlers>
                <add name="iisnode" path="server.js" verb="*" modules="iisnode"/>
            </handlers>
            <iisnode node_env="PRODUCTION"
             nodeProcessCountPerApplication="1"
             maxConcurrentRequestsPerProcess="1024"
             maxNamedPipeConnectionRetry="100"
             namedPipeConnectionRetryDelay="250"
             maxNamedPipeConnectionPoolSize="512"
             maxNamedPipePooledConnectionAge="30000"
             asyncCompletionThreadCount="0"
             initialRequestBufferSize="4096"
             maxRequestBufferSize="65536"
             uncFileChangesPollingInterval="5000"
             gracefulShutdownTimeout="60000"
             loggingEnabled="true"
             logDirectory="iisnode"
             debuggingEnabled="true"
             debugHeaderEnabled="false"
             debuggerPortRange="5058-6058"
             debuggerPathSegment="debug"
             maxLogFileSizeInKB="128"
             maxTotalLogFileSizeInKB="1024"
             maxLogFiles="20"
             devErrorsEnabled="true"
             flushResponse="false"
             enableXFF="false"
             promoteServerVars=""
             configOverrides="iisnode.yml"
             watchedFiles="web.config;*.js" />
            <rewrite>
                <rules>
                    <!-- Don't interfere with requests for node-inspector debugging -->
                    <rule name="NodeInspector" patternSyntax="ECMAScript" stopProcessing="true">
                        <match url="^server.js\/debug[\/]?"/>
                    </rule>
                    <!-- serve static files from /public folder -->
                    <rule name="StaticContent">
                        <action type="Rewrite" url="public/{R:0}" logRewrittenUrl="true"/>
                        <conditions>
                            <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true"/>
                        </conditions>
                        <match url=".*" />
                    </rule>
                    <rule name="DynamicContent">
                        <conditions>
                            <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="True"/>
                        </conditions>
                        <action type="Rewrite" url="server.js"/>
                    </rule>
                    <rule name="SocketIO" patternSyntax="ECMAScript">
                        <match url="socket.io.+"/>
                        <action type="Rewrite" url="server.js"/>
                    </rule>
                </rules>
            </rewrite>
        </system.webServer>
    </configuration>
index.html

    <!doctype html>
<!--[if lt IE 7]>      <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]>         <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]>         <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
  <head>
    <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon"/>
  <!-- <base href="/node/idetikmssql/"> -->
  <title></title>
  <meta name="description" content="">
  <meta name="viewport" content="width=device-width">
  </head>
  <body ng-app="idetikApp">
  <div ng-view=""></div>
  </body>
  <script type="text/javascript" src="bower_components/angular/angular.js"></script>
  <script type="text/javascript" src="bower_components/angular-route/angular-route.js"></script>
  <script type="text/javascript" src="bower_components/angular-resource/angular-resource.js"></script>
  <script type="text/javascript" src="app/app.js"></script>
</html>
ythemain.html

<h1>this is a partial</h1>
<h2>{{mayvar}}</h2>
这是一个局部错误
{{mayvar}}
最后是文件结构的文件路径和服务器IIS配置

服务器配置