wcf
wcf copied to clipboard
dotnet-svcutil generates json which contains absolute path to the referenced assembly.
When I run dotnet-svcutil the generated file dotnet-svcutil.params.json contains absolute path to the dll.
That's not what should go to source control system.
Here's is a solution to reproduce the issue: TypesAreNotReused.zip
- cd to TypesAreNotReused project.
- Run
dotnet-svcutil '.\AdAlliance (RTL) Service Definition - 12mar2024.wsdl' -n "*,MBS.Saleshouse.Webservices.Lib.RTL" -d RTL - Look into generated
dotnet-svcutil.params.json
I also modeled the situation of checking out on different machine where paths are obviously different. Just renamed the solution folder.
I tried to update the service dotnet-svcutil -u afterwards.
I see the path completely removed from the file, and types not reused. How come?
P.S. I'd expect the relative path to proj file, not to dll directly.
This is a continuation of this discussion.
Hi there, after checking out the project resource on different machine, the project needs to be compiled (if it wasn’t) for assembly type reuse to take effect, because at runtime the tool tried to load the project's dependency assembly and inspect for reusable types, if the project is not built the referenced assemblies are inaccessible to the tool, then the types won't be reused.
As for the local referenced assembly path being written to the parameters json file, indeed it could be an issue when type reuse mode is Specified. I am currently drafting a PR to address this.
the project needs to be compiled (if it wasn’t) for assembly type reuse to take effect
This is the reason why the tool should support specifying the reference to the project instead of the assembly. Then it could force the compilation. Or it least it should not ignore the absent references but return an error?