dotnet-svcutil fails to run if passed -r parameter(s) with multiple assemblies with the same name
- Dominant language
- C#
- Stars
- 1.8k
- Forks
- 576
- Avg merge
- 6d 9h
- Merged PRs (30d)
- 2
Description
**Describe the bug**
Following command runs with two `TypesLib.dll` in `-r` parameters and it throws error for dotnet-svcutil but not for svcutil.exe.
`dotnet-svcutil TypeReuseSvc.wsdl -r "..\TypesLib\TypesLib.dll" -r "..\TypesLib2\TypesLib.dll"`
> Error: The option 'reference' already contains the value 'E:\Apps\TypesLib2\TypesLib.dll'.
**Repro step**
1. Create a wcf service project which uses data type TypesLib.TypeReuseCompositeType
2. Create class library TypesLib.csproj and define class TypeReuseCompositeType with same namespace and class mapping as in step1
3. Create class library TypesLib2.csproj and define class TypeReuseCompositeType with same namespace and class mapping as in step1. Configure the project's build property so that its assembly name is TypesLib (same as step2) and has different assembly version than step2.
4. Create empty test directory and run dotnet-svcutil against service endpoint deployed for step1 or its corresponding .wsdl file, passing the command line with -r options to reference assemblies compiled from step2 and step3.
_Expect result:_
The tool runs normally and type TypesLib.TypeReuseCompositeType is reused (reference existing) in the generated reference.cs.
[Issue5182.zip](https://github.com/dotnet/wcf/files/12472907/Issue5182.zip)
Contributor guide
Assessment
This issue has not been assessed yet.