Gabor Varga
Gabor Varga

Reputation: 105

UWP Service Reference does not generate interface and clientbase class

I am developing a server-client application. Some month ago in the UWP application I could generate the service reference without any issues and the same UWP application worked properly both from Windows 10 Desktop and from Raspberry Pi running Windows 10 for IoT (of course compiled to a different CPU). After I did not have so much time to develop. And now I wanted to do it, and after the service reference update, the key objects are missing. Do you know what did happen in the last 2 month? I guess maybe a bug could cause this which was installed with an update becuase it is non-sense to this features gets removed. If I want to add the same service reference to a web application or to a standard desktop application, the client classes are generated as expected.

No changes happened in the web service configuration in the last month therefore it is not possible to this caused the issues.

Anyway I tried to create a new and clean UWP project both on the same and on a different computer, and the service reference generation resulted the same. The interface and client class are always missing.

I tried change the configuration, but no luck.

Thanks a lot! BR Gabor

Upvotes: 1

Views: 272

Answers (1)

Gabor Varga
Gabor Varga

Reputation: 105

I found the issue... I completely commented all the methods (except one) from the interface to test what will happen if I have only one method. The service reference generation worked properly and the interface and client classes have been generated. After I tried the extending the group of methods and I found that a FaultContract attribute on one method had UnauthorizedException, which has not been signed with DataContract attribute. I just don't understand why this worked on all other types of project, except in UWP application??? I don't know, to be honest... After I changed the exception type to a DataContract-ed version of exception, the generation worked immediately, all important classes are available and the communication works as expected.

Upvotes: 2

Related Questions