WCF Service Reference generates empty file

1

I'm having trouble referencing WCF services in Visual Studio. It does not generate any reference to the service classes to reference, the Reference.vb file is almost empty:

'------------------------------------------------------------------------------
' <auto-generated>
'     This code was generated by a tool.
'     Runtime Version:4.0.30319.0
'
'     Changes to this file may cause incorrect behavior and will be lost if
'     the code is regenerated.
' </auto-generated>
'------------------------------------------------------------------------------

Option Strict On
Option Explicit On

I saw old issues in StackOverflow in English to uncheck the "Reuse types in referenced assemblies" combo and it actually generates the file ok. But apart from not liking this approach as a hack, it generates some references with errors:

errors

Removingthe"Global" prefix adds compilation errors, but runtime errors occur.

  • The Services are in a WCF 4.0 project, as well as the WebSite where I'm trying to reference them.

  • If I give "Update Service Reference" and other current Project References that are working, this error happens too.

  • I'm using Windows 8.1 and the error occurred in both Visual Studio 2013 and 2015 CTP.

How do I fix this problem?

    
asked by anonymous 26.01.2015 / 19:41

1 answer

1

This occurred because there was a Reference to an external DLL to the failed project that Visual Studio did not point to.

I found this error by removing the references one by one until the bug stopped.

More precisely, there was a reference to CrystalReports.WebEngine - although I had not installed Crystal Reports Runtime for .NET, I had this assembly possibly installed by Windows 8.1.

It seems that if the project is not 100% ok, even though it is compiling and Visual Studio does not point anything. Bugs in some process of automating the creation of Service Reference source codes. I found that svcutil was generating the code right, but it would be difficult to manually reference and update dozens of WCF Services.

Here is the story and advice for future users who have had a problem with Services References: Review your Project Library References.

    
09.02.2015 / 19:34