1

The Devcurry hottowelsignalr example which utilizes breeze works fine until i upgraded breeze via nuget to 1.3.6.

F12 in chrome shows that it is trying to retrieve metadata from http://localhost/api/breeze/Metadata whereas previously it would use http://localhost/OnlineCollaborationWithSignalR/api/breeze/Metadata. Which is the correct location of the call. It appears that the path of the application is missing from the root. i.e. (OnlineCollaborationWithSignalR)

Update noticed the release notes for 1.3.1. And subsequently changed the routing to

public static class BreezeWebApiConfig {

    public static void RegisterBreezePreStart() {
      GlobalConfiguration.Configuration.Routes.MapHttpRoute(
          name: "BreezeApi",
          routeTemplate: "breeze/{controller}/{action}"
      );
    }
  }

and the app/viewmodels/home.js to

  // service name is route to the Web API controller
    var serviceName = 'breeze/Breeze';

 from
  // service name is route to the Web API controller
    var serviceName = 'api/Breeze';

It still fails with the same error as noted above.

4

1 回答 1

2

您能否确认 API 做出了相应的响应?

根据您的 routeTemplate,它应该是。

http://localhost/breeze/Breeze/Metadata

更新:

是的,如果您的配置是这样的。它应该是

http://localhost/OnlineCollaborationWithSignalR/breeze/Breeze/Metadata

我对具体项目不熟悉,但我下载并更新了它。然后我进行了您指定的更改,并且我收到了来自 API 的响应。虽然我收到了一个错误(很可能是不相关的),但它实际上是正确路由的。

作为记录,我得到的错误是:

"The provider for invariant name 'System.Data.SqlClient' is specified multiple times in the application configuration. The invariant name must be unique for each configured provider."

于 2013-06-24T15:36:25.117 回答