skip to Main Content

I have Windows 10 and Visual Studio 2022 Community on this comp. I have .NET 7 installed.
I want to create a template ASP.NET application.
I run the Visual Studio and go to File→Add → Add project. I select “ASP.NET Core Web application”; then click Next:

enter image description here

The result is the following: Studio really creates the files, but they do not work; I just cannot open the project. For example, here is code of generated *.csproj file:

<Project Sdk="Microsoft.NET.Sdk.Web">

  <PropertyGroup>
    <TargetFramework>net7.0</TargetFramework>
    <Nullable>enable</Nullable>
    <ImplicitUsings>enable</ImplicitUsings>
  </PropertyGroup>

</Project>

Any ideas about the problem?

2

Answers


  1. Chosen as BEST ANSWER

    MSFT

    In response to the "You can edit the screenshots of your Visual Studio Installer without the repair option and the screenshots of you after executing "dotnet --info" into your post":

    I have finally found the Repair option (my installer used a non-English language, this confused me). I have done the Repair; but the problem still ocurrs.

    Aas for the "and the screenshots of you after executing "dotnet --info" into your post" - here it is:

    C:Windowssystem32>dotnet --info

    Host: Version: 7.0.11 Architecture: x86 Commit:
    ecb34f85ec

    .NET SDKs installed: No SDKs were found.

    .NET runtimes installed: Microsoft.AspNetCore.App 6.0.22 [C:Program Files (x86)dotnetsharedMicrosoft.AspNetCore.App]
    Microsoft.AspNetCore.App 7.0.11 [C:Program Files (x86)dotnetsharedMicrosoft.AspNetCore.App] Microsoft.NETCore.App 5.0.17 [C:Program Files (x86)dotnetsharedMicrosoft.NETCore.App] Microsoft.NETCore.App 6.0.22 [C:Program Files (x86)dotnetsharedMicrosoft.NETCore.App] Microsoft.NETCore.App 7.0.11 [C:Program Files (x86)dotnetsharedMicrosoft.NETCore.App] Microsoft.WindowsDesktop.App 5.0.17 [C:Program Files (x86)dotnetsharedMicrosoft.WindowsDesktop.App]
    Microsoft.WindowsDesktop.App 6.0.22 [C:Program Files (x86)dotnetsharedMicrosoft.WindowsDesktop.App]
    Microsoft.WindowsDesktop.App 7.0.11 [C:Program Files (x86)dotnetsharedMicrosoft.WindowsDesktop.App]

    Other architectures found: x64 [c:Program Filesdotnet] registered at [HKLMSOFTWAREdotnetSetupInstalledVersionsx64InstallLocation]

    Environment variables: Not set

    global.json file: Not found

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

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

    Can the "No SDKs were found" be a root cause of the probkem?


  2. It does seem like the SDK or something similar is corrupted, you can fix it with Visual Studio by:

    Open Visual Studio Installer => Find the Visual Studio you are using => More => Repair

    enter image description here

    If it still doesn’t work, you can try reinstalling Visual Studio.

    Finally, if this error still occurs after reinstalling Visual Studio, please open cmd and enter dotnet --info

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search