WCF Service Reference generates empty file

Asked

Viewed 148 times

1

I’m having trouble referencing WCF services in Visual Studio.
It does not generate any reference to the service classes to be referenced, the file Reference.vb 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 in old issues in Stackoverflow in English to uncheck the combo "Reuse types in referenced assemblies" and actually generates the ok file. But in addition to not like this approach for being a "hack", it generates some references with errors:

Reference.vb com erros mistakes

When removing the "Global" prefix, compile errors disappear, but execution errors occur.

  • The Services are in a WCF 4.0 project, as is the Website I’m trying to reference them from.

  • If I give "Update Service Reference" to other current project references that are working, this error also happens.

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

How do I fix this problem??

1 answer

1


occurred because there was a Reference to a DLL external to the failed project, which 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 - which although I had not installed Crystal Reports Runtime for . NET, I had this Assembly possibly installed by Windows 8.1.

Apparently, if the project is not 100% ok, even if it is compiling and Visual Studio does not point out anything. There is a bug in some process of automating the creation of Service Reference sources. I discovered that the svcutil was generating the right code, but it would be complicating referencing and updating dozens of WCF Services manually.

Here is the report and advice for future users who have had some problem with Services References: review their Project Library References.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.