I'm not familiar with Visual Studio Code, so the following isn't an answer for how to create a WPF Application in VS Code, but if desired, one can create a WPF Application using dotnet new .
To see installed SDKs:
To see available templates
To create a new WPF Application:
dotnet new wpf --framework <TargetFramework> --output <fully-qualified path>
see TargetFramework
For example, create a new project in a subfolder of your Documents folder (ex: %UserProfile%\Documents\Projects)
Note: Below you'll notice two subdirectories with the same name (WpfAppTest). The first one is for the solution and the second subfolder (with the same name) is for the project - this is the same structure Visual Studio creates so your solution/project will be usable by both Visual Studio Code and Visual Studio.
dotnet new wpf --framework net7.0 --output "%UserProfile%\Documents\Projects\WpfAppTest\WpfAppTest"
Create solution file:
Note: See dotnet sln for more information.
dotnet new sln --name "WpfAppTest" --output "%UserProfile%\Documents\Projects\WpfAppTest" --project "%UserProfile%\Documents\Projects\WpfAppTest\WpfAppTest\WpfAppTest.csproj"
Add Project to Solution File:
dotnet sln "%UserProfile%\Documents\Projects\WpfAppTest" add "%UserProfile%\Documents\Projects\WpfAppTest\WpfAppTest\WpfAppTest.csproj"
Optional - Add NuGet package
If desired, search for desired NuGet package, for example NuGet package Microsoft.Data.SqlClient.
Download and add desired NuGet package to project (ex: Microsoft.Data.SqlClient)
dotnet add "%UserProfile%\Documents\Projects\WpfAppTest\WpfAppTest\WpfAppTest.csproj" package "Microsoft.Data.SqlClient"
See dotnet add package for more information.
To Build Application:
dotnet build "%UserProfile%\Documents\Projects\WpfAppTest\WpfAppTest.sln"
To Run Application:
dotnet run --project "%UserProfile%\Documents\Projects\WpfAppTest\WpfAppTest\WpfAppTest.csproj"
Use your favorite editor to develop/modify the Console App. Both Visual Studio and Visual Studio Code are available here.