AspNetCore.Docs icon indicating copy to clipboard operation
AspNetCore.Docs copied to clipboard

linux-dev-certs doesn't work with .net6.0

Open pimbogels opened this issue 2 years ago • 5 comments

Description

Following the section: Trust HTTPS certificate on Linux. It guides to install this tool: linux-dev-certs

dotnet tool update -g linux-dev-certs
dotnet linux-dev-certs install

But you can't install this tool with .Net version 6. .Net 8 is required.

/tmp/7148679d-7540-4f18-b87b-7ecf727ba2e2/restore.csproj : error NU1202: Package linux-dev-certs 0.3.0 is not compatible with net6.0 (.NETCoreApp,Version=v6.0) / any. Package linux-dev-certs 0.3.0 supports: net8.0 (.NETCoreApp,Version=v8.0) / any
Tool 'linux-dev-certs' failed to update due to the following:
The tool package could not be restored.
Tool 'linux-dev-certs' 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 tool.
* The required NuGet feed cannot be accessed, perhaps because of an Internet connection problem.
* You mistyped the name of the tool.

For more reasons, including package naming enforcement, visit https://aka.ms/failure-installing-tool

Page URL

https://learn.microsoft.com/en-us/aspnet/core/security/enforcing-ssl?view=aspnetcore-6.0&tabs=visual-studio%2Clinux-sles#ssl-linux

Content source URL

https://github.com/dotnet/AspNetCore.Docs/blob/main/aspnetcore/security/enforcing-ssl.md

Document ID

12ca0b9a-2638-a4ce-c45f-d4579c83dafb

Article author

@tdykstra

pimbogels avatar Oct 10 '24 01:10 pimbogels

cc @amcasey

tdykstra avatar Oct 10 '24 01:10 tdykstra

dotnet --list-sdks output?

Rick-Anderson avatar Oct 10 '24 20:10 Rick-Anderson

dotnet --list-sdks output?

I have now installed both .Net 6 and .net 8 together.

dotnet --list-sdks
6.0.427 [/usr/share/dotnet/sdk]
8.0.403 [/usr/share/dotnet/sdk]

But in my work folder directory I am pointing to .Net 6 only, as that's what my work projects require:

$ cat global.json 
{
  "sdk": {
    "version": "6.0.427"
 }

not sure if that makes any difference. I can run this from a folder before my work folder:

dotnet tool update -g linux-dev-certs
dotnet linux-dev-certs install

however, than I would be using my .net 8.0 sdk. This might work, but then we in .net8.0 territory

pimbogels avatar Oct 11 '24 06:10 pimbogels

Sorry, I'm a bit mixed up about the current and desired states.

The first question seems to be whether linux-dev-certs is intended to work with 6.0. While I suspect it could, I don't believe it's currently published that way. @tmds could confirm.

I think the second question is whether it's okay to run the 8.0 linux-dev-certs and then do app development with 6.0. As I recall, the tool is mostly updating global machine state, so I'd expect it to work.

The third question (and the reason @tdykstra tagged me?) is why our docs say to do something that doesn't work. We should probably confine the note about linux-dev-certs to >= 8.0 (unless it gets updates to support 6.0).

Have I read the issue correctly? Please let me know if I missed something.

amcasey avatar Oct 14 '24 18:10 amcasey

I will confine the note about linux-dev-certs to >= 8.0.

tdykstra avatar Oct 14 '24 19:10 tdykstra