Visual Studio中添加Service异常

异常现象:

在Visual Studion下Service References中尝试Add Service,但是自动生成的Reference.cs是空的。App.config(Web.config)文件不会被更新,没有自动添加Service的配置信息。

解决办法:

大部分原因是因为WCF Service中有方法是用同类型的参数。不要勾选“重用引用程序集中的类型”)

参考地址:http://stackoverflow.com/questions/1408509/sometimes-adding-a-wcf-service-reference-generates-an-empty-reference-cs

Generally I find that it's a T4 codegen issue and most of the time it's because I've got a type name conflict it couldn't resolve.

If you right-click on your service reference and click configure and uncheck "Reuse Types in Referenced Assemblies" it'll likely resolve the issue.

If you were using some aspect of this feature, you might need to make sure your names are cleaned up.

 

另外:

可以用WCFTestClient来测试WCF Service是否是正常工作的。(在VS工具中打开Open Visual Studio Command Prompt,输入”WCFTestClient“)

转载于:https://www.cnblogs.com/SeeMeFly/archive/2013/03/27/2984587.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值