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“)

posted @ 2013-03-27 14:43  See Me Fly  阅读(393)  评论(0编辑  收藏  举报