我已将ASP.NET MVC Web应用程序从.Net 4.5升级到4.5.2。执行此操作后,我开始收到编译器错误说明:
The binding at system.serviceModel/bindings/basicHttpBinding does not have a configured binding named 'FranchiseDirectoryMigrationEndpoint'. This is an invalid value for binding Configuration
这是指StoreConfigurationService的第二个端点。但奇怪的是,它将错误列为Reference.svcmap中的项目中的每个其他服务引用(E.G. The QueueService的Reference.svcmap),而不是StoreConfigurationService。
我尝试更新服务引用(使用VS 2013解决方案资源管理器)并在弹出对话框中出现相同的错误。我最终删除了服务引用并重新创建它以查看是否可以解决它。它现在可以在没有错误的情况下更新服务引用,但是当我尝试构建项目时,我仍然可以获得它。
以下是我在网络应用的web.config中生成的内容:
<system.serviceModel>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true"/>
<bindings>
<basicHttpBinding>
<binding name="StoreConfigurationEndpoint" />
<binding name="FranchiseDirectoryMigrationEndpoint" />
<binding name="DefaultSecuredEndpoint" ...>...</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://localhost:3476/StoreConfigurationService/StoreConfigurationService.svc"
binding="basicHttpBinding" bindingConfiguration="StoreConfigurationEndpoint"
contract="StoreConfigService.IStoreConfigurationService" name="StoreConfigurationEndpoint1" />
<endpoint address="http://localhost:3476/StoreConfigurationService/StoreConfigurationService.svc"
binding="basicHttpBinding" bindingConfiguration="FranchiseDirectoryMigrationEndpoint"
contract="StoreConfigService.IFranchiseDirectoryMigrator" name="FranchiseDirectoryMigrationEndpoint" />
<endpoint address="http://localhost:3476/QueueService/QueueService.svc"
binding="basicHttpBinding" bindingConfiguration="DefaultSecuredEndpoint"
contract="QueueService.IQueueService" name="QueueEndpoint1" />
</client>
以下是服务器端服务端点配置:
<service behaviorConfiguration="WebServices.StoreConfigurationServiceBehavior" name="WebServices.StoreConfigurationService">
<endpoint address="" binding="basicHttpBinding" name="StoreConfigurationEndpoint" bindingConfiguration="" contract="WebServices.IStoreConfigurationService" />
<endpoint address="" binding="basicHttpBinding" name="FranchiseDirectoryMigrationEndpoint" bindingConfiguration="" contract="WebServices.IFranchiseDirectoryMigrator" />
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
</service>
<service behaviorConfiguration="WebServices.QueueServiceBehavior" name="WebServices.QueueService">
<endpoint address="" binding="basicHttpBinding" name="QueueEndpoint" bindingName="" contract="WebServices.IQueueService" />
<endpoint address="mex" binding="mexHttpBinding" name="QueueMetadataEndpoint" contract="IMetadataExchange" />
</service>
我不知道它在说什么。几乎听起来它认为每个服务引用都应该有一个“FranchiseDirectoryMigrationEndpoint”。