How to setup Visual Studio Code without Visual Studio

Guides How to setup Visual Studio Code without Visual Studio

What's this guide for?

It seems that there are problems if you want to use VSCode with the latest C# Extension, without having Visual Studio installed. This guide will explain how to do that, nice and easy.

NOTE: You will NEVER need to have a MS Account for this guide to work.

NOTE: The scope of this guide is to set up VSCode for writing VAM Plugins. This guide will not explain how to set up VSCode for compiling your C# projects
(however, some of the steps may also be necessary to do so).




Step one: Download and install VSCode

Just go there, download and install it: https://code.visualstudio.com/
(Personally I prefer the ZIP version, since you can just unzip it wherever you want).

What you have now is a thing that is not much different from Notepad++ (which is a much bettere version of windows standard notepad with lots of additional features, if you don't know).

To make it usefull and suggest things while you type, you will need to install an extension but, we'll see this later.

NOTE: If you downloaded the ZIP version and you need to update VSCode, you only have to unzip the new version somewhere. Extensions and settings are saved apart.




Step two: Download and install MSBuild

(This is needed by the C# Extension for VSCode)

Go there: https://www.visualstudio.com/downloads/

Scroll down to:

Clipboard_07-01-2024_01ed.jpg


And download this:

Clipboard_07-01-2024_02ed.jpg


Launch the installer and DO NOT SELECT ANY OPTION. Just go forward and install (it's about 130 MB).

(Keep the installer somwhere since you can use it to change things. Not needed for this guide but... who knows...)




Step three: Install C# VSCode Extension

Launch VSCode and IGNORE any welcome procedure \ first setup \ suggestions \ and similar. Just close any tab that opens and dismiss any notification.

On the left sidebar click on "Extensions", search for "C#" and install the latest version of this:

Clipboard_07-01-2024_01.jpg


DO NOT INSTALL THE "C# Dev Kit".

".NET Install Tool" should install itself along with the "C#" Extension. If it doesn't you don't need it (I think...).

NOTE: If you have a notification about a .NET SDK thing that keeps popping up when you start VSCode, you can ignore it. The setup should work anyway. I think it is needed only to compile code (which is not necessary for VAM's plugins).




Final step: Download and unzip my Plugin Template zip file

To make the C# Extension recognize VAM's DLLs and the classes you define in the various .cs files of your plugin, you need a configured .csproj file. You can find it in the attached zip file, along with a simple plugin template with useful comments and already configured to use MacGruber's Utils.

Just be sure to unzip it into a subfolder of "...\Virt-A-Mate\Custom\Scripts\YourCreatorName\"
(where YourCreatorName is the name you want to use as a Creator)

So that the final location of the .csproj file is:
"...\Virt-A-Mate\Custom\Scripts\YourCreatorName\Voithe_Plugin_Template\PluginTemplate.csproj"

You can rename the template folder and the files inside it as you like. Just make sure the names and paths in the .csproj and .cslist files are coerent (you can open them with Notepad - Help comments inside).


And now... launch VSCode, click on File -> Open Folder, point to the template folder and have fun scripting! ;)

Note: When you open a folder for the first time, VSCode will create other folders in there. Of course this is regular.




Extras: Plugin Template "- HUB Release Vn" subfolder

I use this to store the VAR and other things relative to the HUB Release of the plugin, then, I pack the whole Plugin folder (ex Template folder) and store it for archive. You are free to delete this.




DOCUMENTATION:

REMEMBER THAT VAM USES UNITY ENGINE VERSION 2018.1

Manual: https://docs.unity3d.com/2018.1/Documentation/Manual/index.html
Scripting reference: https://docs.unity3d.com/2018.1/Documentation/ScriptReference/index.html





Thanks to:
@everlaster Who helped me to understand how all this thing works and is still helping me a lot in my first C#-Unity experience! ;)



NOTE: Feel free to post corrections, precisations, anything you want. I'll be happy to improve this guide.

Edit: Added second note in the first section.
Author
Voithe
Downloads
302
Views
1,375
Version
2
First release
Last update
Rating
5.00 star(s) 1 ratings

More resources from Voithe

Latest updates

  1. Little edit...

    This text now include also the .cslist file: You can rename the template folder and the files...
  2. Updated Template zip file

    The first one was wrong. Sorry... ?

Latest reviews

it works! Thank you for guide Voithe. : )
Voithe
Voithe
I'm very happy to know that my guide is useful! Thanks! ;)
Upvote 0
Back
Top Bottom