Windows Azure IIS上使用IISNode的Node.js:如何设置节点检查器调试器?

Windows Azure IIS上使用IISNode的Node.js:如何设置节点检查器调试器?,node.js,azure,iis,iisnode,Node.js,Azure,Iis,Iisnode,问题#1 当我使用http://127.0.0.1/mysite/node/server.jsURL它显示了我的测试页面,这是正常的。但是当我使用http://127.0.0.1/mysite/node/server.js/debug/URL。但是,这不起作用,而是继续向我显示相同的示例页面内容 要使调试器工作,我应该做什么 第2期 另外,我注意到,当我转到这个URL时,它会自动重定向到 http://127.0.0.1/mysite/public/mysite/node/server.js/d

问题#1

当我使用
http://127.0.0.1/mysite/node/server.js
URL它显示了我的测试页面,这是正常的。但是当我使用
http://127.0.0.1/mysite/node/server.js/debug/
URL。但是,这不起作用,而是继续向我显示相同的示例页面内容

要使调试器工作,我应该做什么

第2期

另外,我注意到,当我转到这个URL时,它会自动重定向到

http://127.0.0.1/mysite/public/mysite/node/server.js/debug/

为什么会这样?我可以避免这种重定向吗?如果是,如何进行

Web.config内容

  <system.webServer>
    <validation validateIntegratedModeConfiguration="false" />


<!-- Web.Debug.config adds attributes to this to enable remote debugging when publishing in Debug configuration. -->
<!--<iisnode watchedFiles="web.config;*.js"/>--> 

<!-- Remote debugging (Azure Website with git deploy): Comment out iisnode above, and uncomment iisnode below. -->
<iisnode watchedFiles="web.config;*.js"
  loggingEnabled="true"
  devErrorsEnabled="true"
  nodeProcessCommandLine="node.exe &#45;&#45;debug"/>

<!-- indicates that the server.js file is a Node.js application 
to be handled by the iisnode module -->
<handlers>
    <remove name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" />
    <remove name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" />
    <remove name="ExtensionlessUrlHandler-Integrated-4.0" />
    <add name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness32" responseBufferLimit="0" />
    <add name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness64" responseBufferLimit="0" />
    <add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />

    <add name="iisnode" path="node/server.js" verb="*" modules="iisnode" />

    <!-- Remote debugging (Azure Website with git deploy): Uncomment NtvsDebugProxy handler below.
    Additionally copy Microsoft.NodejsTools.WebRole to 'bin' from the Remote Debug Proxy folder.-->
    <add name="NtvsDebugProxy" path="ntvs-debug-proxy/95a6beca-6da8-493c-b380-2822603aa5dc" verb="*" resourceType="Unspecified"
    type="Microsoft.NodejsTools.Debugger.WebSocketProxy, Microsoft.NodejsTools.WebRole"/>
</handlers>

<rewrite>
  <rules>
    <clear />

    <rule name="LogFile" patternSyntax="ECMAScript" stopProcessing="true">
      <match url="^[a-zA-Z0-9_\-]+\.js\.logs\/\d+\.txt$"/>
    </rule>

    <rule name="NodeInspector" patternSyntax="ECMAScript" stopProcessing="true">
      <match url="^server.js\/debug[\/]?" />
    </rule>

    <rule name="StaticContent">
      <action type="Rewrite" url="public{REQUEST_URI}"/>
    </rule>

    <rule name="DynamicContent">
      <conditions>
        <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="True"/>
      </conditions>
      <action type="Rewrite" url="node/server.js"/>
    </rule>

  </rules>
</rewrite>
<!-- <rewrite>
  <rules>
    <clear />
    <!- Remote debugging (Azure Website with git deploy): Uncomment the NtvsDebugProxy rule below. ->
    <!-<rule name="NtvsDebugProxy" enabled="true" stopProcessing="true">
      <match url="^ntvs-debug-proxy/.*"/>
    </rule>->
    <rule name="app" enabled="true" patternSyntax="ECMAScript" stopProcessing="true">
      <match url="iisnode.+" negate="true" />
      <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
      <action type="Rewrite" url="server.js" />
    </rule>
  </rules>
</rewrite> -->
  </system.webServer>

问题1

根据您的描述,您似乎在本地主机或Azure VM上调试和测试您的项目。在这种情况下,我们应该首先确保IIS已经安装了IISNode模块。因此,我建议您可以参考此信息,以确保已成功安装IISNode。
其次,我们应该检查项目是否包含您的节点检查器配置。还可以使用Node.js示例检查节点检查器是否已成功安装。 第三,如果无法使用此调试器,可以按“F12”在启用Webkit的web浏览器中跟踪调试器错误。如果您遇到错误,请在论坛上分享错误并获得进一步支持

问题2

对于第二个问题,似乎URL重写规则导致了这个错误的URL

<rule name="StaticContent">
      <action type="Rewrite" url="public{REQUEST_URI}"/>
</rule>

,因此请求URI服务器变量包含content/default.aspx?tabid=2&subtabid=3

您可以得到“”作为结果。
我建议您可以参考此了解更多详细信息。

您的开发环境是什么?您的IIS和操作系统版本是什么?您是否使用Azure云服务进行Node.js?