Ben Cameron
Ben Cameron

Reputation: 4433

Running Signalr in IIS on .Net Core - hub being hit but client sees 500 error

I have a .net core application deployed to IIS. There is a signalr hub in the application.

My problem is that when my client hits the hub it receives a 500 error back.

I have put logging in the hub and can see that it is being hit correctly and no exceptions are being thrown.

The setup works perfectly when run from Visual Studio.

I am thinking something might not be set up in IIS correctly.

Does anyone have any ideas that this might be?

Upvotes: 0

Views: 1306

Answers (1)

Ben Cameron
Ben Cameron

Reputation: 4433

I enabled the generic error page in the api and looking at the network tab in the browser I was able to see the call that signalr was making.

I looked at the content of this request and found that an error with the following message was being returned by the server...

The data protection operation was unsuccessful

After some searching I found that this was being caused due to a setting on the IIS application pool.

The steps to change the setting were...

  1. Open IIS Manager
  2. Select Applications Pools, and go ahead and select the App Pool used by your app
  3. Right-click on it, and select Advanced Settings, Go to the Process Model Section and Find the “Load User Profile” Option and set it to True

These steps were taken from http://puresourcecode.com/dotnet/post/ASPNET-The-data-protection-operation-was-unsuccessful

Upvotes: 2

Related Questions