信号器 StatusCode 500 VS 2017

Signalr StatusCode 500 VS 2017

我有一个 Class 库,我正试图将其连接到我的网络的 Signlar

SiteConnection = new HubConnection(ConfigurationManager.AppSettings["SignalrSite"]){ Credentials = Credentials.NetworkCredential }; 
SiteHub = SiteConnection .CreateHubProxy("SiteHub "); 
SiteConnection.Start().Wait();

在 VS 2015 中这工作正常。

2017 年我得到...

StatusCode: 500, ReasonPhrase: 'Internal Server Error', Version: 1.1, Content: System.Net.Http.StreamContent, Headers: { Transfer-Encoding: chunked X-SourceFiles: =?UTF-8?B?QzpcRGV2ZWxvcG1lbnRcRUlNXEJPTSBQb3J0YWxcTWFpblxCb20uUG9ydGFsLldlYlxzaWduYWxyXG5lZ290aWF0ZQ==?= Persistent-Auth: false Cache-Control: private Date: Tue, 07 Mar 2017 23:33:46 GMT Server: Microsoft-IIS/10.0 X-Powered-By: ASP.NET Content-Type: text/html; charset=utf-8 }

修复了这个问题。 Visual Studio 必须是 运行 作为管理员。