title: signalR + IIS 404 negotiate angular4 client (1.0.0-preview1-final)
body: <p>I am using ASP.NET Core 2.0 with Microsoft.AspNetCore.SignalR (1.0.0-preview1-final).</p>
  
  <p>I have an issue deploying my application using IIS (with Kestrel). 
  When I run the server in localhost using IIS Express, everything works as expected, but when I try to run on IIS (Windows server or local host windows 7), the negotiate call fail to <em>404</em></p>
  
  <blockquote>
    <p>POST <a href="http://localhost/notification/negotiate" rel="nofollow noreferrer">http://localhost/notification/negotiate</a> 404 (Not Found)</p>
  </blockquote>
  
  <p><a href="https://i.stack.imgur.com/juqwA.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/juqwA.png" alt="404 response content"></a></p>
  
  <p>I tried configuring IIS with different topics found online, but no success.  (<code>&lt;modules runAllManagedModulesForAllRequests="true" /&gt;</code>, extension-less url with <a href="https://support.microsoft.com/en-gb/help/980368/a-update-is-available-that-enables-certain-iis-7-0-or-iis-7-5-handlers" rel="nofollow noreferrer">https://support.microsoft.com/en-gb/help/980368/a-update-is-available-that-enables-certain-iis-7-0-or-iis-7-5-handlers</a>)</p>
  
  <p>But I am still pretty sure the issue is related to my IIS configuration since the entire project works fine on IIS Express...</p>
  
  <p>This is the <code>web.config</code> file used on the test server
  (I removed the different debug tries, since it was not working...)</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;configuration&gt;
    &lt;system.webServer&gt;
      &lt;handlers&gt;
        &lt;add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" /&gt;
      &lt;/handlers&gt;
      &lt;aspNetCore processPath=".\MyProject.Web.App.exe" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" /&gt;
    &lt;/system.webServer&gt;
  &lt;/configuration&gt;
  &lt;!--ProjectGuid: {{some GUID here}}--&gt;
  </code></pre>
  
  <p>Part of the code used in <code>Configure</code> method</p>
  
  <pre><code>        app.UseSignalR(route =&gt;
          {
              route.MapHub&lt;NotificationHub&gt;("/notification");
          });
          app.UseMvc(routes =&gt;
          {
              routes.MapRoute(
                  name: "default",
                  template: "{controller=Home}/{action=Index}/{id?}");
              routes.MapSpaFallbackRoute(
                  name: "spa-fallback",
                  defaults: new { controller = "Home", action = "Index" });
          });
  </code></pre>
  
  <p>Part of the code used in <code>ConfigureServices</code> method </p>
  
  <pre><code>        services.AddMvc()
          services.AddSignalR();
          services.AddSession();
  </code></pre>
  
  <p>Angular application code</p>
  
  <pre><code>constructor() {
      /** ... **/
  
      this.hubConnection = new HubConnection('/notification', {
          transport: TransportType.LongPolling
      });
  
      this.hubConnection.on('Update', (data: string) =&gt; {
          let res = new DefaultNotificationInfo(data);
          /** ... **/
      });
  
      this.hubConnection.start()
          .then(() =&gt; {
              this.join().then(next =&gt; {
                  // nothing to do on join, the socket is running
              }).catch(error =&gt; {
                  console.error(error)
              });
          })
          .catch(err =&gt; {
              console.error(err)
          });
  }
  
  private join(): Promise&lt;any&gt; {
      return this.hubConnection.invoke('Join');
  }
  </code></pre>
  
  <hr>
  
  <p><strong>Versions informations :</strong></p>
  
  <p>IIS :  <strong>7.5</strong></p>
  
  <p>APP net package.json:</p>
  
  <pre><code>        {
          /** ... **/
          "@aspnet/signalr": "^1.0.0-preview1-update1",
          "@aspnet/signalr-client": "^1.0.0-alpha2-final",
          /** ... **/
          }
  </code></pre>
  
  <p>API asp net nuget version : <strong>(1.0.0-preview1-final)</strong></p>
  
  <hr>
  
  <p>After reading 
  <a href="https://blogs.msdn.microsoft.com/webdev/2017/09/14/announcing-signalr-for-asp-net-core-2-0/" rel="nofollow noreferrer">https://blogs.msdn.microsoft.com/webdev/2017/09/14/announcing-signalr-for-asp-net-core-2-0/</a> and 
  <a href="https://blogs.msdn.microsoft.com/webdev/2018/02/27/asp-net-core-2-1-0-preview1-getting-started-with-signalr/" rel="nofollow noreferrer">https://blogs.msdn.microsoft.com/webdev/2018/02/27/asp-net-core-2-1-0-preview1-getting-started-with-signalr/</a>, I am pretty sure I've covered everything from their tutorial/quick-start</p>
  
  <p>Is there something I missed?</p>
  
  <hr>
  
  <h2>Update 1</h2>
  
  <p>After finding this : <a href="https://stackoverflow.com/a/43014264/3198096">https://stackoverflow.com/a/43014264/3198096</a>
  I tried to enable the LoadUserProfile property of my ApplicationPool using this link <a href="https://blogs.msdn.microsoft.com/vijaysk/2009/03/08/iis-7-tip-3-you-can-now-load-the-user-profile-of-the-application-pool-identity/" rel="nofollow noreferrer">https://blogs.msdn.microsoft.com/vijaysk/2009/03/08/iis-7-tip-3-you-can-now-load-the-user-profile-of-the-application-pool-identity/</a></p>
  
  <p>But this is still failing to 404.</p>
  
  <p>I also tried to "Attach to process" on my application to see if there was any logs corresponding to my <code>Hub</code> or to the <code>/negotiate</code> url, but there was none.</p>
  
  <p><em>(also added a screenshot of the 404 result)</em></p>
  
  <h2>Update 2</h2>
  
  <p>This is an extract of package.config from the Web.App </p>
  
  <p><a href="https://i.stack.imgur.com/vfUP7.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/vfUP7.png" alt="package.config file extract"></a></p>
  
  <h2>Update 3</h2>
  
  <p>This is the configuration of the server hosting the applications.
  You can see 3 different website. All of them have almost the same configuration. (Just the port changing, which define 3 different test environment access) </p>
  
  <p><a href="https://i.stack.imgur.com/oqUBM.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/oqUBM.png" alt="IIS server Config"></a></p>
  
  <p>And this is the basic localhost developer IIS, which I guess i generated by Visual Studio.</p>
  
  <p><a href="https://i.stack.imgur.com/SBYuz.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/SBYuz.png" alt="IIS local Config"></a></p>