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

Command "dotnet tool update" fails if root directory contains several projects #482

Closed
kkostenkov opened this issue Jul 11, 2024 · 4 comments

Comments

@kkostenkov
Copy link

Command dotnet tool update is run as soon as Action starts and due to a very old bug in the tool it fails if the directory contains multiple projects.

In my case this is a game changer because some Unity projects have .sln and .csproj files in the root of the repo.

Maybe the parsing and execution of workingDirectory parameter could be moved to the beginning of the action? Then maybe that parameter could be used as a workaround with the value of ./..

@kkostenkov
Copy link
Author

This branch could be used for the repro

@muno92
Copy link
Owner

muno92 commented Jul 17, 2024

@kkostenkov
Sorry for slow responding.

After version 1.11.13, workingDirectory parameter is executed on the begining of the action.

Is your problem is solved?

@kkostenkov
Copy link
Author

Thank you so much for the reply. Meanwhile I did the investigation on my own and it appears that the dotnet tool update command is present in two places in the repo. (My lack of knowledge did not allow me to understand why)
And the first execution of it comes before the main.ts flow and fails even if I change the working directory.

Yesterday I did another iteration to solve the matter and it appears that those changes help:

  1. Moving workingDirectory parameter parsing
  2. Adding await to process.chdir(workingDir)
    And the most important
  3. Adding process.chdir(..) to Installer class in index.js . This is the other place of calling dotnet tool update

I personally have no idea why 1 & 2 are needed since I managed to make it work without using workingDirectory parameter in the end, but without those changes the workflow kept failing.

So to answer your question directly: no. Simply moving the execution of workingDirectory parameter won't help to solve the issue.

@muno92
Copy link
Owner

muno92 commented Nov 27, 2024

This issue is closed as it is not active.

@muno92 muno92 closed this as completed Nov 27, 2024
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