c# – .NET Core中的WCF引用
发布时间:2020-12-15 21:04:14 所属栏目:百科 来源:网络整理
导读:如何将WCF引用到我的.NET Core客户端?我下载并安装“WCF Service Preview”插件,但是当我尝试添加引用时,我收到了错误 Error: No endpoints compatible with .Net Core apps were found. An error occurred in the tool. Failed to generate service refere
如何将WCF引用到我的.NET Core客户端?我下载并安装“WCF Service Preview”插件,但是当我尝试添加引用时,我收到了错误
当我在浏览器中尝试服务时,工作正常.有任何想法吗 ? <?xml version="1.0"?> <configuration> <appSettings> <add key="aspnet:UseTaskFriendlySynchronizationContext" value="true"/> </appSettings> <system.web> <compilation debug="true" targetFramework="4.5"/> <httpRuntime targetFramework="4.5"/> <httpModules> <add name="ApplicationInsightsWebTracking" type="Microsoft.ApplicationInsights.Web.ApplicationInsightsHttpModule,Microsoft.AI.Web"/> </httpModules> </system.web> <system.serviceModel> <services> <service name="ServiceLayer.TeamManagementService" behaviorConfiguration="GetDataBehavior"> <endpoint address="" binding="webHttpBinding" contract="ServiceLayer.ITeamManagementService" behaviorConfiguration="GetDataEndpointBehavior"></endpoint> </service> </services> <behaviors> <serviceBehaviors> <behavior name="GetDataBehavior"> <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true"/> <serviceDebug includeExceptionDetailInFaults="true"/> </behavior> </serviceBehaviors> <endpointBehaviors> <behavior name="GetDataEndpointBehavior"> <webHttp/> </behavior> </endpointBehaviors> </behaviors> <protocolMapping> <add binding="basicHttpsBinding" scheme="https"/> </protocolMapping> <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true"/> </system.serviceModel> <system.webServer> <modules runAllManagedModulesForAllRequests="true"> <remove name="ApplicationInsightsWebTracking"/> <add name="ApplicationInsightsWebTracking" type="Microsoft.ApplicationInsights.Web.ApplicationInsightsHttpModule,Microsoft.AI.Web" preCondition="managedHandler"/> </modules> <directoryBrowse enabled="true"/> <validation validateIntegratedModeConfiguration="false"/> </system.webServer> </configuration> 解决方法
我几天前遇到了类似的问题,并且找不到特定原因来解释为什么端点无法被扩展程序正确识别.我通过创建一个包含实际WCF服务代理的类库项目来解决这个问题.然后,NET Core项目可以引用此项目并间接调用没有连接引用的服务.
如果您还没有找到问题的解决方案,请查看我的github存储库以查看示例: (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |