question

GGunnfs-5814 avatar image
1 Vote"
GGunnfs-5814 asked MaryOB commented

Visual Studio 16.9 Not Installing .NET 5

I tried to set up a new project in Vst 2019.2 (Microsoft Visual Studio Community 2019 (2)
Version 16.9.2). it was not available and I tried "install other framework and installed the.net 5 64 bit sdk and runtime.

however .net did not show up as a choice, same after restarting Vstd as well as rebooting pc.. I also tried the visual studio installer, but failed to find an option for that.

Btw: I'm running on windows 10 pro with latest updates
and the project is windows form app

what else can I do?



dotnet-csharpvs-setup
f3.png (48.0 KiB)
· 9
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Open the Developer PowerShell window in Visual Studio and run dotnet --list-sdks what shows up? You can also run the command from the DOS command line,

79368-f1.png

79373-f2.png

Or double click on the project in Solution Explorer and replace the contents (preserve other sections) with this, do a clean and rebuild, what happens?

 <Project Sdk="Microsoft.NET.Sdk">
    
     <PropertyGroup>
         <OutputType>WinExe</OutputType>
         <LangVersion>9.0</LangVersion>
         <TargetFramework>net5.0-windows</TargetFramework>
         <UseWindowsForms>true</UseWindowsForms>
     </PropertyGroup>
    
 </Project>

79369-f3.png


0 Votes 0 ·
f1.png (40.9 KiB)
f2.png (17.3 KiB)
f3.png (48.0 KiB)

Nothing happens at the Windows cmd prompt. From the Developer PowerShell I get a single line 5.0.301 [C:\Program Files\dotnet\sdk] . When I double click on the project is Solution explorer I get project properties, not a file where I can replace anything. Then you add a screen shot of File Explorer with no explanation. Anyway, no joy.

0 Votes 0 ·


I I tried but failed
from the " dotnet --list-sdks", I got the following dot 5 versions:
5.0.200-preview.21077.7 [C:\Program Files\dotnet\sdk]

5.0.201 [C:\Program Files\dotnet\sdk]

changed the project file manually the target framwork to:
<TargetFrameworkVersionfsfsa>net5.0-windows</TargetFrameworkVersion>

Reloading the project, I got

0 Votes 0 ·

Did you download from here

https://dotnet.microsoft.com/download

This
<TargetFrameworkVersionfsfsa>net5.0-windows</TargetFrameworkVersion>
Should be
<TargetFramework>net5.0-windows</TargetFramework>

0 Votes 0 ·

What kind of new projects do you want to create in Visual Studio? Did you go to New Project wizard, then select C#, “Console Application” or “Windows Forms App”?

0 Votes 0 ·

when I used <TargetFrameworkVersion>.. instead of <TargetFramework>.... vst complained about ms build during reload. that imply I had to either modify the file C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets (No way U do that one as novice). or verify the subdirectory of dotnet frame work in c:\programs files or c:\programs files(x86)

0 Votes 0 ·

I wrote a ton of code sample and use what I gave you in all .NET 5 samples as seen here in a forms project and in a console project here. The proper download.


0 Votes 0 ·

I did get the right download, I even went for donwload againa nd fc them, no dif.
the problem is not the windows forms prroject. it's the vst somehow not getting the right framework..
I'm tempted to go back on .net 4.7.2 that works

0 Votes 0 ·

I get error : The application for the project is not installed.

0 Votes 0 ·

1 Answer

AnnaXiu-MSFT avatar image
0 Votes"
AnnaXiu-MSFT answered GGunnfs-5814 commented

Hi @GGunnfs-5814 ,

Welcome to Microsoft Q&A!

Could you tell me the target framework of your Windows Forms project? .NET Core or .NET Framework?

If you are creating a Windows Forms App (.NET Framework) project, I am afraid that you can’t find the .NET 5.0 in your project.
Actually, the .NET 5.0 is the next major release of .NET Core following 3.1 instead of .NET Framework.

Sincerely,
Anna


If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.



· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

sign! have to wait for release then. and use 4.7.2 for now
thx anyways

0 Votes 0 ·