-
Notifications
You must be signed in to change notification settings - Fork 253
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
When restoring DotNetCliToolReferences, choose TargetFramework to restore with based on what the tool package targets #5067
Comments
We are taking a look at this again now that we have ruled out performing an implicit restore before running tools, but at this point I don't think it will make it in 4.3. //cc @rrelyea |
I just want to let you guys know that this particular issue is really hard to debug if you encounter subtle failures like: fsprojects/FAKE#2097. Even if this is not implemented an error notifying if "restore framework <> runtime framework" would drastically improve the situation. |
@matthid Sorry for the problems you had with dotnet-fake. We are working on local tools, which will be similar to DotNetCliToolReference tools, but will support the same tool packages as are used for global tools. See here for some more information: https:/dotnet/cli/issues/9782#issuecomment-410033494 As such, we don't expect to fix this issue with DotNetCliToolReference |
@dsplaisted That's what I thought. While we have already support 'global tools' via the While from a users perspective I'd urge you to implement a error/warning message for the above situation, I can understand that you don't want to invest any more time in that feature. |
For .NET CLI tools, we want to run the tools on the same version of .NET Core as the tool targets. A tool built for 1.1 should run using the 1.1 shared framework, and a tool built for 2.0 should use the 2.0 shared framework. The tools need to be restored using the same target framework they will run on (otherwise a tool running on 1.1 could end up bringing in 2.0 assets, which would fail).
Currently, the
DotnetCliToolTargetFramework
property can be set to control what target framework is used when restoring tools. However, different tools in the same project may need to be restored for different target frameworks, and furthermore there's no way for the SDK / CLI to know what version of .NET Core the tools target until the package has been downloaded.We (@rrelyea, @emgarten, @livarcocc, and @dsplaisted) met to discuss this and came up with the following design:
DotnetCliToolTargetFramework
will be interpreted by NuGet restore as the maximum target framework that tools can be restored forDotnetCliToolTargetFramework
. (IE if a tools package has folders for netcoreapp1.0, netcoreapp2.0, and netcoreapp3.0, and theDotnetCliToolTargetFramework
is netcoreapp2.1, then it would select netcoreapp2.0.)DotnetCliToolTargetFramework
, the package feeds used, the version of NuGet, etc.).tools\dotnet-mytool\1.0.0-rc\netcoreapp2.0\<hash>
.<BaseIntermediateOutputFolder>\.tools\<toolname>.json
.The text was updated successfully, but these errors were encountered: