THis is about setting up VS code to develop C# winform applications.
Firstly download and install VS Code. It has no plugin or library yet, so next it needs to install extension to support C# and .Net etc.
On the 'extension' tab on the left pane:
install C#
install Nuget Package Manager (for installing library such as JSON)
Download and install .NET Core SDK from Microsoft. This is outside of VS Code, but VS Code will detect and use it for .Net development.
Install JSON library using Nuget Package Manager:
from menu 'view' -< Command Palette to run nuget command
>nuget
Select 'NuGet Package Manager : Add package'
Search for json
select Newtonsoft.Json
select a version
Done
Create a dev folder and open the folder from VS Code
Now to create a winform project. This is done through command line. No select and click like in Visual Studio. About what commands are available and how to use them, refer to https://docs.microsoft.com/en-us/dotnet/core/tools/ for DotNet command CLI
From Terminal -> new Terminal
Run commnand:
>donet new winforms --name 'test winform project'
Then it automatically generates the project folder and the files:
including, bin, obj, Form1.cs, .csproj, Program.cs, etc.
But there seems no editing UI, it may be another plugin thing. For now, you can go and edit the Form1.cs to add in buttons, labels, etc.
To run the app, Run -> Run without debugging
To publish an app / winform with it's dependencies, use the dotnet publish command
The runtime can be windows, osx, linux, etc. Check the Dotnet CLI for details
>dotnet publish --runtime win-x64 --self-contained true
The command will wrap everything into a folder, the DLLs and the exe. The --self-contained is by default true.
The publish command by default adds all the language supports into the publish folder. To keep only english for example, add the following configuration into the .csproj file.
<PropertyGroup>
<SatelliteResourceLanguages>en</SatelliteResourceLanguages>
</PropertyGroup>