Skip to main content
improved formatting, better readability
Source Link
marc_s
  • 759.8k
  • 186
  • 1.4k
  • 1.5k

.netNET is not recognized

In a .NET Core C# project, I get many errors such aslike this:

"PredefinedPredefined type 'System.Object' is not defined or imported".imported

  • Reinstalled Visual Studio 2026 Insider and 2022. This didn't help.
  • Reinstalled .NET SDKs (10, 8, netstandard.NET Standard 2.1). This didn't help.
  • Checked the environment variables, which seem fine.

"YouYou must install .netNET Desktop runtime to run this application".application

.net is not recognized

In a .NET C# project, I get many errors such as:

"Predefined type 'System.Object' is not defined or imported".

  • Reinstalled Visual Studio 2026 Insider and 2022. This didn't help.
  • Reinstalled .NET SDKs (10, 8, netstandard 2.1). This didn't help.
  • Checked the environment variables, which seem fine.

"You must install .net Desktop runtime to run this application".

.NET is not recognized

In a .NET Core C# project, I get many errors like this:

Predefined type 'System.Object' is not defined or imported

  • Reinstalled Visual Studio 2026 Insider and 2022. This didn't help
  • Reinstalled .NET SDKs (10, 8, .NET Standard 2.1). This didn't help
  • Checked the environment variables, which seem fine

You must install .NET Desktop runtime to run this application

improved formatting, better readability
Source Link

In a .netNET C# project, I get many errors such as "Predefined type 'System.Object' is not defined or imported".
Primary:

"Predefined type 'System.Object' is not defined or imported".

Primary variables such as intint and stringstring are not recognized.
I reinstalled Visual Studio 2026, Insider and 2022, but it didn't help.
I reinstalled .net SDKs (10,8, netstandard 2.1) It didn't help.
I

I have checkedtried the Environment variables, it seems OK.
Whenfollowing:

  • Reinstalled Visual Studio 2026 Insider and 2022. This didn't help.
  • Reinstalled .NET SDKs (10, 8, netstandard 2.1). This didn't help.
  • Checked the environment variables, which seem fine.

When I ran dotnetrun --infodotnet --info in cmdthe command prompt, all SDKs and runtimes are installed.
When

When I run an .exe.exe application which is madecreated by a .netNET project, I get the following message "You must install .net Desktop runtime to run this application". Architecture:

"You must install .net Desktop runtime to run this application".

Application architecture x64, Appand app host version: is 8.0.21
The.

The result of running: dotnet --list-sdksdotnet --list-sdks is:

The result of running dotnet --infodotnet --info is:

In a .net C# project, I get many errors such as "Predefined type 'System.Object' is not defined or imported".
Primary variables such as int and string are not recognized.
I reinstalled Visual Studio 2026, Insider and 2022, but it didn't help.
I reinstalled .net SDKs (10,8, netstandard 2.1) It didn't help.
I have checked the Environment variables, it seems OK.
When I ran dotnet --info in cmd all SDKs and runtimes are installed.
When I run an .exe application which is made by a .net project, I get the message "You must install .net Desktop runtime to run this application". Architecture x64, App host version: 8.0.21
The result of running: dotnet --list-sdks

The result of running dotnet --info

In a .NET C# project, I get many errors such as:

"Predefined type 'System.Object' is not defined or imported".

Primary variables such as int and string are not recognized.

I have tried the following:

  • Reinstalled Visual Studio 2026 Insider and 2022. This didn't help.
  • Reinstalled .NET SDKs (10, 8, netstandard 2.1). This didn't help.
  • Checked the environment variables, which seem fine.

When I run dotnet --info in the command prompt, all SDKs and runtimes are installed.

When I run an .exe application created by a .NET project, I get the following message:

"You must install .net Desktop runtime to run this application".

Application architecture x64, and app host version is 8.0.21.

The result of running dotnet --list-sdks is:

The result of running dotnet --info is:

Source Link
Dadkhah
  • 125
  • 8

.net is not recognized

In a .net C# project, I get many errors such as "Predefined type 'System.Object' is not defined or imported".
Primary variables such as int and string are not recognized.
I reinstalled Visual Studio 2026, Insider and 2022, but it didn't help.
I reinstalled .net SDKs (10,8, netstandard 2.1) It didn't help.
I have checked the Environment variables, it seems OK.
When I ran dotnet --info in cmd all SDKs and runtimes are installed.
When I run an .exe application which is made by a .net project, I get the message "You must install .net Desktop runtime to run this application". Architecture x64, App host version: 8.0.21
The result of running: dotnet --list-sdks

2.1.818 [C:\Program Files\dotnet\sdk]
8.0.416 [C:\Program Files\dotnet\sdk]
9.0.308 [C:\Program Files\dotnet\sdk]
10.0.100 [C:\Program Files\dotnet\sdk]

The result of running dotnet --info

.NET SDK:
 Version:           10.0.100
 Commit:            b0f34d51fc
 Workload version:  10.0.100-manifests.5fb86115
 MSBuild version:   18.0.2+b0f34d51f

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.26200
 OS Platform: Windows
 RID:         win-x64
 Base Path:   C:\Program Files\dotnet\sdk\10.0.100\

.NET workloads installed:
There are no installed workloads to display.
Configured to use workload sets when installing new manifests.
No workload sets are installed. Run "dotnet workload restore" to install a workload set.

Host:
  Version:      10.0.0
  Architecture: x64
  Commit:       b0f34d51fc

.NET SDKs installed:
  2.1.818 [C:\Program Files\dotnet\sdk]
  8.0.416 [C:\Program Files\dotnet\sdk]
  9.0.308 [C:\Program Files\dotnet\sdk]
  10.0.100 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.All 2.1.30 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.App 2.1.30 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 8.0.22 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 9.0.11 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 10.0.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 2.1.30 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.36 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 8.0.22 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 9.0.11 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 10.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.WindowsDesktop.App 8.0.22 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 9.0.11 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 10.0.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Other architectures found:
  x86   [C:\Program Files (x86)\dotnet]
    registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation]

Environment variables:
  Not set

global.json file:
  Not found

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

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