iisnode icon indicating copy to clipboard operation
iisnode copied to clipboard

Handler "iisnode" has a bad module "iisnode" in its module list when running in Visual studio and IIS Express 8

Open andriidrebot opened this issue 11 years ago • 5 comments

On my Windows 8.1 x64 I have installed IIS Express 8 RTM x64 and iisnode 0.2.18 x64. I am also using node v0.12

In Visual Studio settings I have checked Use 64 bit version of IIS Express.

My web.config:

<configuration>
  <system.webServer>
    <handlers>
      <add name="iisnode" path="app.js" verb="*" modules="iisnode" />
    </handlers>
  </system.webServer>
</configuration>

And I am getting an error "Handler "iisnode" has a bad module "iisnode" in its module list" What am I missing?

andriidrebot avatar Jun 11 '15 08:06 andriidrebot

You may need to add the module in the config:

<globalModules>
    <add name="iisnode" image="C:\Program Files (x86)\iisnode-express\iisnode.dll" />
</globalModules>

I basically got it to work by running IIS Express from the command line: http://www.iis.net/learn/extensions/using-iis-express/running-iis-express-from-the-command-line

beautifulcoder avatar Jun 11 '15 18:06 beautifulcoder

@beautifulcoder I've tried that but still have the same error. The only difference I have is a full version of iisnode (so I use path C:\Program Files (x86)\iisnode\iisnode.dll), but as far as I understand it is allowed according to the installation guideline

andriidrebot avatar Jun 12 '15 08:06 andriidrebot

I recommend installing the x86 express version of iisnode. I got it to work with Node.js x64 and IIS Express 8 x86

beautifulcoder avatar Jun 15 '15 17:06 beautifulcoder

Make sure iisnode schema file is present in C:\Program Files\IIS Express\config\schema and make sure iisnode module is in both globalModules section and the modules section. C:\Program Files\IIS Express\AppServer\applicationHost.config --

rramachand21-zz avatar Apr 07 '16 20:04 rramachand21-zz

This is still a problem in IIS Express 10 used to debug in VS 2017 (Version 15.4.0). I got it to work by adding all of the same iisnode directives from a windows installed IIS application.config, into the project's application.config (which affects IIS Express in VS 2015+), which are found here:

<path_to_solution_folder>/.vs/config/application.config

I searched for "iisnode" in the windows installed IIS application.config found here:

C:\Windows\System32\inetsrv\config

and copied those "iisnode" tags into the appropiate nodes for the project's application.config, shown below:

(I have included the structure of "where" I added the iisnode tags, and the ... represents there is a large space in between)

<configuration>
    ...
    <configSections>
        ...
        <sectionGroup name="system.webServer">
             ...
            <section name="iisnode" />
	</sectionGroup>
    </configSections>
   ...
        <globalModules>
             ...
            <add name="iisnode" image="%programfiles%\iisnode\iisnode.dll" />
        </globalModules>
...
    <configSections>
        <sectionGroup name="system.webServer">
            ...
            <section name="iisnode" />
        </sectionGroup>
    </configSections>
...
        <tracing>
             <traceProviderDefinitions>
                <add name="WWW Server" guid="{someGuidThatIsntThisText}">
                    <areas>
                        ...
                        <add name="iisnode" value="32768" />
                    </areas>
                </add>
             </traceProviderDefinitions>
         </tracing>
...
     <location path="" overrideMode="Allow">
        <system.webServer>
            <modules>
                ...
		<add name="iisnode" />
            </modules>
            ...
        </system.webServer>
     </location >

</configuration>

sec0ndhand avatar Oct 27 '17 18:10 sec0ndhand