dotnet / dotnet/aspnetcore

While trying to run on WSL "Failed exporting the certificate"

Open
#58,599 0 comments 0 reactions 0 assignees View on GitHub
area-networking
Dominant language
C#
Stars
38.4k
Forks
10.9k
Avg merge
2d 5h
Merged PRs (30d)
276

Description

I was running ASP NET on WSL using Visual Studio without issues. Now after some reinstalls, I am getting an error with certificates. All the other like http, https, IIS are working fine. However I would need to have WSL available as well. Does anybody know how to make it work and fix this certificate issue?

I think I have tried already all the solutions available on the Internet. I have tried resetting Windows, installing WSL from the scratch with different Linux distributions. Removing existing localhost certificates from Certificate manager and also exporting from Windows and importing Windows certificates to WSL Ubuntu.

So every time I click WSL button in Visual Studio to run on WSL, I am getting this:

![Image](https://github.com/user-attachments/assets/36a4cfe0-1b78-47be-aa48-a13299104881)

On my WSL Ubuntu when running `dotnet --info` :

```
Host:
Version: 8.0.10
Architecture: x64
Commit: 81cabf2857
RID: ubuntu.24.04-x64

.NET SDKs installed:
No SDKs were found.

.NET runtimes installed:
Microsoft.AspNetCore.App 8.0.10 [/usr/lib/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 8.0.10 [/usr/lib/dotnet/shared/Microsoft.NETCore.App]

Other architectures found:
None

Environment variables:
Not set

global.json file:
Not found

Learn more:
https://aka.ms/dotnet/info

Download .NET:
https://aka.ms/dotnet/download
```

I have installed SDK before couple of times, but it says now again `No SDKs were found.`

In `launchSettings.json` in Server project I have this:

```
"WSL": {
"commandName": "WSL2",
"launchBrowser": true,
"launchUrl": "https://localhost:7210",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development",
"ASPNETCORE_URLS": "https://localhost:7210;http://localhost:5013"
},
"distributionName": ""
}
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.