WCF reference.cs suddenly does not include classes

I have developed a WCF service that has been working fine for several weeks. I publish this service for IIS directly from the development server. I have a dev testing application that includes this WCF service as a service reference in its own project.

My WCF class library also references another project in a Visual Studio solution, and many classes are in a project referenced by services and calling applications.

Today, after publishing some changes in the service (I did not make any changes to the project or its classes), three of the approximately 20 classes in the referenced project are no longer included in the service link of my test application, I can no longer use them in the code , and they are no longer in Reference.cs. I double-checked that the classes in question are still decorated with [DataContract], and the properties are still decorated with [DataMember] in the service solution.

Everything in Visual Studio is OK. I rebuilt and republished all the missing classes configured to compile, I tried resetting IIS, completely deleted the IIS site, and made a clean publication, but it did not help. I tried to remove the service link in the test application and get a clean proxy every time. Nothing works.

Then I tried to create a dummy class in the referenced project, and inlined it. Re-published the service, and even this dummy class does not appear in Reference.cs. I will completely lose why these classes are not included in the .dll for the reference project after its publication, since it is obvious that everything builds OK in Visual Studio.

+4
source share
3 answers

I wanted to go back and post what caused my problem:

I made changes, and none of my service methods used 3 β€œmissing” classes as the return type or parameter. I just had to comment on the methods that these classes used to use them again. Now it makes sense, but I was convinced that something else was wrong.

+4
source

I am facing such a problem. The following steps will help you 1. Right-click Tools (in the Help section for project maintenance) 2. In the update help service, click Advanced. 3. Make as an attached image. enter image description here

+5
source

I encountered a similar problem and resolved it by following these steps.

Add your endpoint address using mexHttpsBinding. For example, consider the address as mex .

When configuring service help, add / mex at the end of the service URL.

https://service.domain.com/serivce1.svc/mex

This will allow metadata sharing . Therefore, Reference.cs will be changed / added (if you are adding a service link for the first time).

Please make sure your service has an endpoint with mexHttpBinding / mexHttpsBinding

Change In the analysis, I found that this problem occurs when a service opens through more than two endpoints (including the mex endpoint)

0
source

Source: https://habr.com/ru/post/1386794/


All Articles