wcf icon indicating copy to clipboard operation
wcf copied to clipboard

dotnet-svcutil generates json which contains absolute path to the referenced assembly.

Open voroninp opened this issue 1 year ago • 2 comments

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.

image

Here's is a solution to reproduce the issue: TypesAreNotReused.zip

  1. cd to TypesAreNotReused project.
  2. Run dotnet-svcutil '.\AdAlliance (RTL) Service Definition - 12mar2024.wsdl' -n "*,MBS.Saleshouse.Webservices.Lib.RTL" -d RTL
  3. 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.

voroninp avatar Apr 08 '24 07:04 voroninp

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.

imcarolwang avatar Apr 12 '24 02:04 imcarolwang

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?

voroninp avatar Apr 12 '24 10:04 voroninp