Как изменить версию NET Framework в Visual Studio C#?
Изменение требуемой версии .NET Framework. Для существующего проекта Visual Basic, C# или F# вы можете изменить целевую версию .NET в диалоговом .
Как узнать какой NET Framework нужен?
Откройте редактор реестра (regedit.exe) и перейдите в раздел HKLM\ SOFTWARE\Microsoft\NET Framework Setup\NDP. В этой ветке хранится информация обо всех версиях . NET на компьютере.
Как обновить версию NET Framework?
Убедитесь, что установлены последние версии Net Framework и DirectX. Для этого нужно сначала установить обновление для Net Framework отсюда: http://go.microsoft.com/?linkid=9831986. Затем убедитесь, что у вас установлена последняя версия DirectX (выполните это действие, даже если недавно вы этим уже занимались).
Как изменить версию NET Framework в Visual Studio C#? Ответы пользователей
4 ответа · 24. В Visual Studio: Щелкните правой кнопкой мыши на своем проекте · 3. Щелкните правой кнопкой мыши по проекту в проводнике решений и выберите .
Во-первых, .NET 6 и .NET Framework 4.5 это хоть и разные платформы, но думаю для начала освоения подойдут и туториалы для .NET Framework .
Подскажите пож как её перекомпелирова ть ?? Добавлено через 4 минуты. Компилятор Visual Studio 2013. Помощь в написании контрольных, курсовых и .
Через visual studio installer установите fraemwork4.8 и в версии fraemwork выберите 4.8.
C# уже не молодой язык и как и вся платформа .NET уже прошел большой путь. Первая версия языка вышла вместе с релизом Microsoft Visual Studio .
Начало работы с языком C#. Где скачать .NET Framework и .NET 6. Установка необходимого инструментария. Среда Visual Studio.
Visual Studio 2019.3 (версия 16.3) ·.NET Framework (все версии) – C# 7.3 ·.NET Standard 2.0 и предыдущие – C# 7.3 ·.NET Standard 2.1 – C# 8 ·.
NET в проекте на ту, которая установлена у вас. Во вкладке Приложение можно поменять версию проекта. Visual Studio .
How to upgrade all solution projects .Net framework 4.5.1 to 4.8 Visual Studio 2019
I have a solution in Visual Studio 2019 with many C # projects. I need to retarget all of the projects from the .NET Framework 4.5.1 to 4.8. Is it possible to change target at once or do I have to do it separately with every single one of them?
PS: I tried ‘TargetFrameworkMigrator’, but it doesn’t work with (VS2019) / .net 4.8.
Thank you for your help.
5 Answers 5
VS unfortunately doesn’t provide an easy way for .NET framework, and every project file has it’s own setting. So the easiest way is probably a «Edit -> Find and Replace- > Replace in Files» on the directory in VS or any text editor you like.
For Framework projects, in every .csproj you want <TargetFrameworkVersion>v4.8</TargetFrameworkVersion> (from <TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion> ), if you have any packages.config , there is targetFramework=»net48″ (from targetFramework=»net451″ ). You will need to reload the solution after changing for VS to see them.
Relplace all occurances of
in the all *.csproj files. You can use Notepad++ for it.
![]()
So i gone through the PR’s on Git, so you are not alone. Someone has already posted a release package which works for .NET 4.8 with VS2019
Here is the OPEN PRs, which is waiting to be merged
release for VS2019 which actually works, according to the commit and comments. Give it a try
![]()
Target Framework Migrator is now available for the Visual Studio 2019 and .Net 4.8. Unfortunately does not work for Core or .Net 5 / 6 .
Keep in mind that tpdating the XML node <TargetFrameworkVersion> value with a text editor sounds fair solution, consider that the old format of the .csproj file also stores the target framework versions of the nuget dependencies and these should be updated to reduce possibilities of unexpected runtime errors.
After updating the projects target framework, you should reinstall all nuget packages. VS will tell this, but you can check this as well: How to reinstall NuGet packages
![]()
A few years later, if it can help some developers, as Target Framework Migrator does not work on VS2022, there is now a Microsoft .NET Upgrade Assistant that you can find on the VisualStudio Marketplace: https://marketplace.visualstudio.com/items?itemName=ms-dotnettools.upgradeassistant&ssr=false#review-details
Unfortunately, it does not allow to migrate from old .NET FW to new .NET FW 4.8 or 4.8.1, but only to: .NET 6.0 or 7.0 or 8.0, .NETSTandard 2.0 or 2.1
Where the upgrade tool is after vsix install (right click on project): 
Upgrading your .NET projects with Visual Studio

Now you can upgrade any .NET application to the latest version of .NET inside of Visual Studio! We are happy to introduce it as a Visual Studio extension and will upgrade your .NET Framework or .NET Core web- and desktop apps. Some project types are in development and coming soon, see the details below.
Why upgrade and to what version?
If your applications are built for .NET Framework or .NET Core, now is a great time to upgrade them to .NET 6 (Long Term Support version) or .NET 7 (Standard Term Support version) that have much better performance and give you access to the latest features and capabilities. There have been huge improvements between .NET Framework and the latest .NET, but even if you’re targeting .NET Core 3.1 or earlier, it has reached the end of support in December 2022.
We recommend to port to .NET 6 or .NET 7!
Between those two, .NET 6 has longer support time and .NET 7 is the latest, so has newer features. We release a new version of .NET every year in November and every even version number is supported for 3 years (Long Term Support, or LTS for short). So, you can either stay on the latest cutting-edge tech and upgrade every year, or switch from LTS to LTS once every 2-3 years.
About Upgrade Assistant
Upgrading your application, especially from .NET Framework, was a complicated process. We kept prototyping and improving in this area to simplify your upgrades. In the past, you might have used the Upgrade Assistant CLI tool or Microsoft Project Migrations. We have collected your feedback, big thanks to everyone who filled in our survey or left us comments, created issues and feature requests! To address your feedback, we concluded that we needed to provide a unified upgrade experience for every project type inside of Visual Studio.
Now you will be able to upgrade every type of .NET application from any initial version (.NET Framework or .NET Core) by right-clicking on your project in Solution Explorer and choose “Upgrade”. Don’t forget to install the extension first.
The general philosophy of Upgrade Assistant is that it will take care of the mechanics, but depending on what framework and project type you’re upgrading from, you should expect to do some manual post processing. While we try to automatically fix breaking changes, it cannot detect and fix all of them. So you might need to make some additional modifications to get the code to compile and you need to test thoroughly to ensure your code continues to work as expected.
Supported application types
We have a goal to support every .NET project type. Also, we think of this tool not just as a one-time upgrade from .NET Framework to .NET 6/7, but as the way to upgrade your application to the latest .NET in the future as well. Besides changing the target framework version, the tool will be able to modify your code to fix breaking changes. These are our plans for the future, and currently here is what the tool supports in the latest version:
Supported
- ASP.NET
- Class libraries
- Console
- WPF
- WinForms
These workloads are at parity with Upgrade Assistant CLI tool.
Coming soon
- Xamarin to .NET MAUI migration
- UWP to WinUI migration
- WCF to WCF Core migration
Those migration types are in development, and you already can upgrade these projects, but we don’t have the code fixers for these projects yet. If you need to migrate these project types today, we recommend using the existing Upgrade Assistant command line tool, which already has code fixers. The Visual Studio extension will get them soon too.
Different upgrade types
Upgrade assistant supports 3 upgrade types. Different types are recommended for different project types, so you will see only those options that would work well for your app.
- In-place. In this case your original project will be upgraded all at once. If you are using source control and prefer to manage the copies yourself, for example, by using branches, this option is for you.
- Side-by-side. With this option your original project will be untouched, and a copy of it will be added to the solution which will contain the upgraded code. This type can be handy if your application has many dependencies that might be broken after the upgrade. This way you can check-in your progress and not worry about the application not building.
- Side-by-side incremental. This is the ideal choice for web applications. Upgrade from ASP.NET to ASP.NET Core requires a lot of work and at times manual refactoring (because these two technologies are very different). Class Libraries are often used together with web apps, so we enable this type of upgrade for Class Libraries as well. Incremental upgrade will put a .NET 6/7 project next to your existing .NET Framework project and route endpoints that are implemented in the .NET 6/7 project there, while all other calls will be sent to .NET Framework application. This way you can combine upgrade with feature development and move your items to .NET 6/7 one by one without breaking your app. This approach was originally built in Microsoft Project Migrations tool, you can think of Upgrade Assistant in Visual Studio as a new improved and extended version of Microsoft Project Migrations. Upgrading from .NET Core or .NET 5 to .NET 6/7 is much easier than from .NET Framework, so for those cases In-place option is recommended.
In the table below you can find the status of all upgrade types by project type.
| In-place | Side-by-side | Side-by-side incremental | |
|---|---|---|---|
| ASP.NET from .NET Framework | N/A | N/A | supported |
| ASP.NET from .NET Core, .NET5+ | supported | N/A | N/A |
| WinForms from .NET Framework | supported | supported | N/A |
| WinForms from .NET Core, .NET5+ | supported | N/A | N/A |
| WPF from .NET Framework | supported | supported | N/A |
| WPF from .NET Core, .NET5+ | supported | N/A | N/A |
| Class Library from .NET Framework | supported | supported | supported |
| Class Library from .NET Core, .NET5+ | supported | N/A | N/A |
| Console from .NET Framework | supported | supported | N/A |
| Console from .NET Core, .NET5+ | supported | N/A | N/A |
| Xamarin to MAUI | in development | in development | N/A |
| MAUI from older versions | in development | N/A | N/A |
| UWP to WinUI | in development | in development | N/A |
| WinUI from older versions | in development | N/A | N/A |
| Azure Functions | in development | N/A | N/A |
| WCF to WCF Core | in development | N/A | N/A |
Step by step upgrade
- Install Upgrade Assistant Visual Studio extension.
- In Visual Studio in Solution Explorer right-click on the project you want to upgrade, choose Upgrade.

- You will see the main page with a few options for your upgrade.
Which option to choose is described in different upgrade types. - For this example, I choose In-place. Side-by-side would be very similar with a few extra steps. Additional features of side-by-side incremental are described in our previous blog post.
- Then you need to choose the framework you want to upgrade to. The tool will suggest only options that make sense for your project type. In my example, it’s a .NET Framework class library so it also suggests .NET Standard.
All upgrades are forward, meaning that if your project for example is already on .NET 6, only .NET 7 and later will be offered. If you do not have the chosen SDK installed on your computer, you’ll be prompted to install it on the next step. Simply follow the link and go back to your upgrade after the SDK is installed. .NET Standard is suggested only for Class Libraries that were targeting .NET Framework. - Now is time to choose the components you’d like to upgrade. Eventually you will need to upgrade everything, but if you prefer doing it step-by-step, this is the screen to select what do you want to start with.

- After you click Upgrade selection you will see the progress of your upgrade and a report after it is completed.

Summary
You can now upgrade your .NET projects right from inside Visual Studio. Please tell us how this works for you and what else you’d need for your projects by filling out this brief survey.
You can also file issues or feature requests from Visual Studio by choosing Help | Send Feedback. Ensure to mention “Upgrade Assistant vsix” in the title.
Как обновить установленные .NET SDK?
Dotnet —info показывает установленные SDK: Теперь я хотел бы обновить их / добавить новые. Есть ли для этого команда? В настоящее время я использую для этого установщик Visual Studio.
1 ответ
Есть несколько вариантов.
- Загрузите и обновите прямо из Интернета: https://dotnet.microsoft.com/download/ visual-studio-sdks
- Делайте то, что делаете . используйте установщик Visual Studio
Если вы запрашиваете способ сделать это с помощью интерфейса командной строки dotnet (возможно, для DevOps или автоматизированных сценариев), то с самим dotnet этого способа сделать нельзя. Однако вы можете сделать это, используя скрипты:
Здесь есть дополнительная информация для установки на базе Windows. .
Один нюанс к вашему вопросу: я не думаю, что вы можете (или должны) просто «обновить»; вам нужно установить. Причина в том, что SDK предназначены для параллельной работы, поэтому «обновление» не имеет смысла.