質問

私は最も基本的な例で問題を抱えています https://github.com/signalr/signalr/wiki/quickstart-persistent connections. 。 「エコー/ネゴシエートで404」を取得します

役に立ちましたか?

解決

例は古くなっています。これは、デフォルトのMVCプロジェクトが呼び出されるためです RegisterRoutes(routeTable.routes);MapConnectionをRegisterRoutesの内部に移動する必要があります。 routes.ignoreroute( "{resource} .axd/{*pathinfo}"; しかし、他のルートの前。

これが役立つことを願っています

他のヒント

基本的な永続的な接続サンプルを実装しようとするときにまったく同じエラーがありましたが、Newtonsoft.jsonのバージョンの不一致、ここで説明する問題と解決策によるものであることに気付くのにかなりの時間がかかりました。

https://github.com/signalr/signalr/issues/195

つまり、次のようなセクションを追加します。

<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.8.0" newVersion="4.0.8.0" />
</dependentAssembly>

あなたのweb.configに。

私が理解している限り、それをNugetによって自動的に追加する必要があるので、おそらくVisual Studio 11ベータと関係があるので、なぜそのセクションが私に欠けているのかわかりません。とにかく、それは私の問題の解決策でした。

2つのステップがあります。
web.config ルールJSONを追加または編集します

 <dependentAssembly> <assemblyIdentity name="Newtonsoft.Json"
 publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
 <bindingRedirect oldVersion="0.0.0.0-4.0.8.0" newVersion="4.0.8.0" />
 </dependentAssembly>


2. in Global.asax 新しく追加する:

RouteTable.Routes.MapConnection<ChatConnection>("negotiate", "/chat");


メソッドで protected void Application_Start(){}

幸運を !

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top