6
votes

I deployed an ASP.NET 5 MVC 6 app on Azure, and ran into this problem with SignalR 2: when starting connection from client, call to

/signalr/negotiate?clientProtocol=1.5&connectionData=%5B%7B"name"%3A"gameHub"%7D%5D&_=1460028930688

fails with error 500.

The exception behind error 500 is this:

Exception Details: System.Security.Cryptography.CryptographicException: The data protection operation was unsuccessful. This may have been caused by not having the user profile loaded for the current thread's user context, which may be the case when the thread is impersonating.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[CryptographicException: The data protection operation was unsuccessful. This may have been caused by not having the user profile loaded for the current thread's user context, which may be the case when the thread is impersonating.]

I read and tried solution suggested at SignalR CryptographicException on AzureWebsites, but id didn't work for me.

As I understand, Azure doesn't allow LoadUserProfile.

Any workaround?

1
Did you ever manage to resolve this? I'm having the same issuemichaelmsm89
I've been trying to resolve this error also. SignalR works fine localhost, but I deploy to azure and Internal 500 error.JoshYates1980

1 Answers

3
votes

I had the same problem and my fix was to add a call to UseAesDataProtectorProvider() before my call to MapSignalR(). Hope this helps someone.