ここで私はこのスレッド内の回答に基づいて、入って来た厳密解です\ Scriptsフォルダ内に置かれている場合、スクリプトはhttp:// {yourhost}/scripts/{scriptName}で利用可能になります( 'copy if newer'各ファイルの 'Copy To Output Directory'に設定する必要があります)
public class Startup
{
public void Configuration(IAppBuilder app)
{
// Branch the pipeline here for requests that start with "/signalr"
app.Map("/signalr", map =>
{
// Setup the CORS middleware to run before SignalR.
// By default this will allow all origins. You can
// configure the set of origins and/or http verbs by
// providing a cors options with a different policy.
map.UseCors(CorsOptions.AllowAll);
var hubConfiguration = new HubConfiguration
{
// You can enable JSONP by uncommenting line below.
// JSONP requests are insecure but some older browsers (and some
// versions of IE) require JSONP to work cross domain
// EnableJSONP = true
};
// Run the SignalR pipeline. We're not using MapSignalR
// since this branch already runs under the "/signalr"
// path.
map.RunSignalR(hubConfiguration);
});
// Serving javascript libraries required for client as static content from Scripts folder
app.UseStaticFiles(new StaticFileOptions() {
RequestPath = new PathString("/scripts"),
FileSystem = new PhysicalFileSystem(@".\Scripts"),
});
}
}
ITマン
スクリプト/ jquery-1.10.2.min.jsはクライアント側の一部です。シグナルサーバーのホストから提供できますか? –
@ITMan:私は私のアンカーを編集しました。このソリューションは機能します。私はそれを短く試しました。 – Tester
あなたの答えのインスピレーションを得て得ました。ご協力いただきありがとうございます!私はこのスレッド内の答えをどのようにマークするのか分かりません...? @IT Man。 –