C# – Sometimes adding a WCF Service Reference generates an empty reference.cs

cnetwcf

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?

Best Answer

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.