Questions tagged [visual-studio-2022]

Visual Studio 2022 is a version of Microsoft's Visual Studio. Do not use this tag unless you have a specific question about this specific version.

Visual Studio 2022 is a version of Microsoft's Visual Studio. Do not use this tag unless you have a specific question about Visual Studio 2022. Visual Studio 2022 was released to market (RTM) on Nov 8th 2021. It is the first 64-bit release of Visual Studio. It can now take full advantage of modern hardware in order to reliably scale to larger, more complex projects.

Some Major Changes and Improvements

  • First release of 64-bit version with major performance improvements
  • Find in Files is faster (3X than previous version).
  • Better dev tools for C++ and .NET, and Hot Reload
  • Multi-repo support with Git in the IDE
  • Updates for Blazor & Razor editors + Hot Reload for ASP.NET
  • Updated Look and Feel (new Icons)
  • IntelliCode improvements
    • Whole line completion
    • Quick Actions recommendations

Release notes can be found at the official Microsoft page.

3495 questions
13
votes
4 answers

Scaffold-DbContext from package manager console is giving a System.NullReferenceException

I have started to face this issue just recently. I'm using the Visual Studio 2022 Preview latest. I made a few simple changes to the DB and used the validation tool in dbForge Studio 2022 for SQL Server to validate all objects. The DB is valid. When…
DoomerDGR8
  • 4,840
  • 6
  • 43
  • 91
13
votes
3 answers

Hot Reload not working in Visual Studio 2022 .Net 6 Razor projects

We just upgraded all but one of our web app projects from .NET Core 3.1 projects to .NET 6 in our solution. These were ASP.NET Core 3.1 projects using Razor. Here are the results we're seeing with respect to Hot Reload: The .NET 6 projects hot…
user3002092
  • 495
  • 2
  • 11
  • 29
13
votes
2 answers

How to set target net7.0 -windows?

I try change WinExe net6.0-windows true to
Vy Do
  • 46,709
  • 59
  • 215
  • 313
13
votes
4 answers

Disabling .NET 6 features per default

When creating a new project in VS 2022 with .NET 6, following new features are added automatically: Top-Level Statements Implicit Usings and Nullable References Is there a way to create a .NET 6 project without top-level-statements (a workaround…
A.B.
  • 2,374
  • 3
  • 24
  • 40
13
votes
1 answer

error the in razor.g.cs file, can't find in VS, can't find the _razor.g.cs file

I'm getting "; expected" error in my .razor file and in _razor.g.cs file, In previous blazor versions I was finding these g.cs files in the solution folder, now I can't find them there, and double clicking on the error message in VS doesn't point me…
buga
  • 852
  • 9
  • 21
13
votes
2 answers

Why is constexpr of std::wstring().capacity() not equal to std::wstring().capacity()?

I'm not sure if I'm too naïve or simply too unknowing. But why does the following differ? constexpr auto nInitialCapacity1 = std::wstring().capacity(); const auto nInitialCapacity2 = std::wstring().capacity(); In Visual Studio 2022/17.0.5 the…
Martin Lemburg
  • 507
  • 2
  • 12
13
votes
1 answer

How do I expand all files and folders in Visual Studio Solution Explorer

There's a button to collapse all, and I use it often. Sometimes, rarely, I want to expand everything, but there's no button for that.
Kevon
  • 984
  • 8
  • 28
13
votes
1 answer

Prevent a Console App (.NET Core) from printing "exited with code 0." in VS2019 and VS2022

When I start a Console App (.NET Core) with Ctrl+F5 (Start Without Debugging) in Visual Studio Community 2019 (Version 16.3.1), the following message is appended in the Console window at the end: C:\HelloWorld\bin\Debug\netcoreapp3.0\HelloWorld.exe…
Theodor Zoulias
  • 34,835
  • 7
  • 69
  • 104
12
votes
3 answers

Enabling javascript debugger in VS 2022 freezes application

I have been searching for an answer for 2 days now so really hope someone can help. When I try to debug my project the application freezes, nothing happens in the browser it just keeps loading and there are no error messages. I realized that…
12
votes
3 answers

iisexpresstray crashes when starting a site from visual studio

I am a VS2022 user. I updated it to version 17.5.0. Every time I try to view in the browser, the iisexpresstray (IIS Express) appears. But when you pass the mouse disappears. An error appears in Event Viewer. IIS Express is still working. I have…
12
votes
1 answer

Visual Studio 2022 shows git repo as "Untrusted"

Visual Studio 2022 has started showing one of my git repos as "Untrusted". What does this mean? How can I fix it?
Bradley Uffner
  • 16,641
  • 3
  • 39
  • 76
12
votes
3 answers

.NET Core not showing in target framework dropdown for visual studio 2022

I have installed .NET core 3.1 and verified i can run .NET core 3.1 apps on my machine however when i go to create a new project the dropdown for target frameworks only allows .NET 6.0. I am using visual studio 2022. I am using visual studio 2019 on…
Maxqueue
  • 2,194
  • 2
  • 23
  • 55
12
votes
7 answers

There was an error running the selected code generator: Unable to resolve service for type 'Microsoft.EntityFrameworkCore.DbContextOption

I am using Visual Studio 2022 Preview and .NET 6 SDK. Here I am creating a webAPI project with 2 layers. api project (Bgvsystem.webAPI) class library (BgvSystem.Persistance) NuGet packages- Install-Package Microsoft.EntityFrameworkCore.SqlServer…
11
votes
2 answers

Precompiled header errors in Visual Studio 2022 version 17.6

I have a Visual Studio C++ project, and after updating Visual Studio 2022 recently from version 17.5 to version 17.6, the compilation stops in the very beginning with the error: 1>------ Rebuild All started: Project: MRPch, Configuration: Debug x64…
Fedor
  • 17,146
  • 13
  • 40
  • 131
11
votes
1 answer

MSB4019 error when building MVC 5 app after cloning from DevOps on Mac

I just got a new mac and installed the latest VS 2022. I cloned a DevOps repository with a ASP.Net Mvc 5 app. The app always ran fine on my Windows machine, but when I try to build it on my Mac, I am getting this error Error MSB4019: The imported…
cytek04
  • 472
  • 5
  • 17