question

01150896 avatar image
0 Votes"
01150896 asked mr-pourghorban commented

Visual studio .net problem

Hello.
I reinstalled windows 10. Installed visual studio 2022.

When start a project, .NET framework 4.0 is required

Error when installing .NET framework 4.0

Microsoft .NET Framework 4 is already part of this operating system. Installation of the .NET Framework 4 Redistributable is not required

How to start a project? Update it to last .NET framework?

170151-36ed8b04-3094-4fd5-b6c5-e8e0d3f2662e.jpg


windows-10-generalvs-generalwindows-formsdotnet-runtime
· 5
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.

Hello @01150896 , what kind of project are you going to start(create and develop)? Like what Castorix31 mentioned, did you choose and install the required workloads and components? Besides, please make sure you have updated Windows OS and there is no Windows Update error.

0 Votes 0 ·
01150896 avatar image 01150896 TianyuSun-MSFT ·

Visual studio was installed after all windows updates

I installed visual studio many times, with standard components, and everything always worked. But not now..

0 Votes 0 ·

Hi @01150896 , please try to repair .NET Framework by using Microsoft .NET Framework Repair Tool and check again.

0 Votes 0 ·
Show more comments
Castorix31 avatar image
0 Votes"
Castorix31 answered 01150896 commented

Have you installed ".NET Desktop Development" ?

Like in the picture :

To install the .NET Framework Developer Pack or Targeting Pack


· 5
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.

I don't see .NET Desktop Development 4.0
i installed .NET framework 4.8 but the problem persisted

0 Votes 0 ·

There is no ".NET Desktop Development 4.0"

Have you checked ".NET Desktop Development" in the Workloads ?
( +components on the right)

0 Votes 0 ·

this is not working.

Installation notes:

.NET Framework 4.5 and later versions replace .NET Framework 4.0. When you install these versions on a system that has .NET Framework 4 installed, the assemblies are replaced.

Could this be a problem?

0 Votes 0 ·

You cannot check and install ".NET Desktop Development" ?!

And what is installed ?
commands like :
dotnet --list-sdks
dotnet --list-runtimes



0 Votes 0 ·

@Castorix31 sorry.
You uploaded a GIF yesterday. It is not displayed now
Can you repeat the message again?

0 Votes 0 ·
EckiS avatar image
0 Votes"
EckiS answered

This has nothing to do with installing the .NET runtime or Windows 10.
you don't have the target pack for .NET Framework 4 installed.
When you opened the solution you will have got a dialog like this:
170612-image.png
and the option to download the target pack.

But .NET Framework 4.0 is no longer supported, so you need to target a newer version anyway (4.6.2 or higher).
microsoft-net-framework



image.png (14.7 KiB)
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.

satyakarki-5933 avatar image
1 Vote"
satyakarki-5933 answered mr-pourghorban commented

Hi @01150896, if you are still having issues then it may be helpful for you. Visual Studio 2022 supports .NET Framework 4.6 to the upper version. So go to Visual Studio installer -->modify -->individual component -->select the required framework and install it(click Modify option). I would recommend the latest one. Then open the project and upgrade it to the available target framework that you have installed.176531-target-pack.png



target-pack.png (39.6 KiB)
· 2
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.

Hello everyone,
i had the same problem and @satyakarki-5933 solution worked for me.

Cheers

0 Votes 0 ·

hi
this is worked for me
thank you

0 Votes 0 ·
VerschaeveStijnHelan avatar image
0 Votes"
VerschaeveStijnHelan answered mr-pourghorban commented

Hi,
I have the same issue, but an upgrade is not possible for me. Is there another way?

· 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.


hi
you must install .net SDK you need

so go to Visual Studio installer -->modify -->individual component -->select the required framework and install it

0 Votes 0 ·