问题描述
有时添加 WCF 服务引用会生成一个空的 reference.cs,我无法在项目中的任何位置引用该服务.
Sometimes adding a WCF Service Reference generates an empty reference.cs and I cannot reference the service anywhere in the project.
有人遇到过这种情况吗?
Has anyone encountered this?
推荐答案
通常我发现这是一个代码生成问题,大多数是因为我有一个类型名称冲突无法解决.
Generally I find that it's a code-gen 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.
这篇关于有时添加 WCF 服务引用会生成一个空的 reference.cs的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!