Closed drewnoakes closed 5 years ago
Thanks, uploaded here: https://www.nuget.org/packages/strans
(Should be available in an hour or so)
Just tested this and got an error:
$ dotnet tool install -g strans
error NU1212: Invalid project-package combination for strans 0.0.4. DotnetToolReference project style can only contain references of the DotnetTool type
The tool package could not be restored.
Tool 'strans' failed to install. This failure may have been caused by:
* You are attempting to install a preview release and did not use the --version option to specify the version.
* A package by this name was found, but it was not a .NET Core tool.
* The required NuGet feed cannot be accessed, perhaps because of an Internet connection problem.
* You mistyped the name of the tool.
+1 on the error reported by @drewnoakes. Trying to install it on WSL here...
Yup, I am aware of the problem. Working on a fix will resume on Tuesday. Thanks for reporting.
Ok, it turns out the combination of self-contained exes with PackAsTool does not work. It seems that this will be fixed in some upcoming dotnet version.
The problem: With PackAsTool, we cannot release for linux and macos, without PackAsTool, we cannot, well, pack a valid global dotnet tool.
For now, I will hotpatch the csproj file to contain the flag when generating the NuGet package. Hopefully, this will no longer be necessary in the future.
@rirze or @drewnoakes Could you confirm that this works? Thanks!
dotnet tool install -g strans -v n
Build started 3/29/19 5:23:41 PM.
(...)
CACHE https://api.nuget.org/v3-flatcontainer/strans/index.json
CACHE https://api.nuget.org/v3-flatcontainer/strans/0.0.5/strans.0.0.5.nupkg
(...)
Build succeeded.
0 Warning(s)
0 Error(s)
Time Elapsed 00:00:00.97
You can invoke the tool using the following command: strans
Tool 'strans' (version '0.0.5') was successfully installed.
Yes this works now! Thanks for the fix
Given this is written in C# it'd make a great dotnet global tool.
This would reduce the installation step, across all platforms, to:
Further operations:
https://docs.microsoft.com/en-us/dotnet/core/tools/global-tools https://docs.microsoft.com/en-us/dotnet/core/tools/global-tools-how-to-create