I have just installed the new version of Visual Studio Community Edition (version 17.6.2). Now, I have a project with a Console application project in NET7. Usually I can run this console application and it runs in a normal shell window.
After the upgrade, the Console Application requires WSL (Windows Subsystem for Linux). Why? Now, Visual Studio shows an error popup message:
Click on OK
, it opens the Microsoft Store and I click on Debian.
After few seconds, in the PowerShell window I get this message
WslRegisterDistribution failed with error: 0x80370114
Error: 0x80370114 The operation could not be started because a required feature is not installed.
So, I open a new PowerShell window and I try to install manually a Linux distribution using
wsl --list
wsl --list --online
wsl --install Ubuntu-22.04
but again I get the same error.
This is the project properties
First question: why I can’t run the console application as usual? An then, why do I need WSL (that I have installed any way)? How can I fix the issue?
Update
If in the property of the project I select as target OS Windows
, the application is still running in the Output window. Basically, Visual Studio doesn’t open a prompt window to run the application.
Options
The Terminal under Environment in the Options has as default Developer PowerShell
.
2
Answers
Hi the error message indicates that you didn’t install/enable wsl successfully.
In order to fix the error WslRegisterDistribution failed with error: 0x80370114
You need to turn on the windows feature "Virtual Machine Platform".
Locate the file launchSettings.json that is placed under your project folder, in sub-folder "Properties".
Then edit the file and remove the following bunch of lines: