Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
voroninp opened this issue Apr 8, 2024 · 2 comments
Assignees

Comments

@voroninp
Copy link

voroninp commented Apr 8, 2024

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.

@imcarolwang
Copy link
Contributor

imcarolwang commented Apr 12, 2024

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.

@voroninp
Copy link
Author

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants