Open xuejiaW opened 4 months ago
Hi, I'm facing the same issue performing the dotnet tool install into a running container to build in gitlab.
In my case I see the issue with dotnet sdk 6.0.417-focal. I spent a lot of time trying to figure out what's the issue and it seems to me that the dotnet tool install command is executed before the dotnet pack completes as the pack was executed in background and not synchronously when the cli completes.
I was able to workaround the issue performing a "dotnet build-server shutdown" in between the dotnet pack and the dotnet install commands: maybe it's unrelated, maybe it's just creating a delay that permits to the dotnet pack command to complete, however, to me, it mitigated the issue unblocking the pipeline development.
It seems like the instructions changed to making microsoft.botsay instead of CowSay, but I'm assuming that isn't relevant.
I made microsoft.botsay per the instructions except that I changed the framework to net8.0 instead of net6.0 as you did. I packed it then tried to install it globally, and it worked properly (with my 9.0 preview).
Then I deleted my .dotnet folder so that most of the path would be absent, and it just recreated it without a problem.
I tried the same with 8.0.108 and 8.0.400, and neither of those seemed to have a problem.
Is there anything I did wrong with trying to reproduce this (other than using a slightly different version of dotnet)?
Describe the bug
I am following the global dotnet tool tutorial from https://learn.microsoft.com/en-us/dotnet/core/tools/global-tools-how-to-create , but i make target framework as 8.0 rather than the 6.0 in the tutorial.
After i pack the tool, i want to install it by
dotnet tool install --global --add-source .\nupkg CowSay
, but theSystem.IO.DirectoryNotFoundException
exception thrown.The full dotnet info is :
The csproj is:
i am sure the nupkg has been created:
If i install the tool with version, i.e,
dotnet tool install --global --add-source .\nupkg CowSay --version 1.0.1
, it works. But theversion
option should not be necessary. I have tried in .net 7, the install command can succeed without--version