dotnet / dotnet/wcf

Reuse of Types not working with WCF dotnet-svcutil tool for .NET Core

Open
#4,277 9 comments 10 reactions 1 assignee Assigned to @imcarolwang View on GitHub
enhancement tooling triaged
Dominant language
C#
Stars
1.8k
Forks
576
Avg merge
6d 9h
Merged PRs (30d)
2

Description

**Common Types in assembly references are not reused**

**To Reproduce**
1- I produced the common types from Common.xsd with xsd.exe in C# classes:

C:\Users\xxx\source\repos\BrokerSln\Broker\WSDL\uAPI_WSDLschema_Release-V19.2.0.12>xsd.exe /c common_v49_0\Common.xsd /namespace:Broker /out:..\\..\\..\\CommonBroker\Common\

I made sure to have the namespace called **Broker**

2- I added the classes in the class library project called CommonBroker of target framework .Net Standard 2.0

![1](https://user-images.githubusercontent.com/16133485/82366790-12483680-9a13-11ea-86d9-9a797e2b1606.png)

I compiled the project with no problem.

I expect the type **Broker.typeErrorInfo** to be reused.

![2](https://user-images.githubusercontent.com/16133485/82367255-ccd83900-9a13-11ea-9dc2-79349b8bc74c.png)

3- I added a new class library project called Broker of target framework .Net Standard 2.0

The project references the CommonBroker project

![3](https://user-images.githubusercontent.com/16133485/82367382-fe510480-9a13-11ea-99d2-0f8ef0813ffb.png)

I add a new WCF reference

![4](https://user-images.githubusercontent.com/16133485/82367509-33f5ed80-9a14-11ea-864b-ed0aa4566c7f.png)

I also make sure the namespace is **Broker**

![5](https://user-images.githubusercontent.com/16133485/82367648-728ba800-9a14-11ea-95c3-9ba9770409f0.png)

We can see the project CommonBroker is in the reused types

![6](https://user-images.githubusercontent.com/16133485/82367734-8e8f4980-9a14-11ea-8bf5-14a465bd21f2.png)

I generate the code

![7](https://user-images.githubusercontent.com/16133485/82367776-a23ab000-9a14-11ea-91de-406c997ba107.png)

And unfortunately the type **Broker.typeErrorInfo** is generated again in Reference.cs

![8](https://user-images.githubusercontent.com/16133485/82368951-8801d180-9a16-11ea-9cce-e754ad106370.png)

How can we make sure the tool can spot the reused types in our assembly?

Thanks for your help

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.