Setting Up a Development Environment using Visual Studio

From GTA Network Wiki
Jump to navigation Jump to search

Setting Up a Development Environment using Visual Studio

Requirements

  • Basic C# programming knowledge

Installation process

The installation of Visual Studio 2017 is fairly simple, the installer by default does not install the required packages, so we're gonna do that on our own. Once we run the installer, we'll be prompted to choose our install options/packages, by default the Visual Studio installs the required files for the standard .NET development but not the new experimental one, so we'll make sure to install the experimental .NET Core development packages by clicking on it.

Error creating thumbnail: Unable to save thumbnail to destination

Setting Up The Project

Before you setup the project in Visual Studio Code, make sure you have an appropriate directory to place your projects in. Also be sure you have extracted the server files somewhere.

For this tutorial, my server files will be extracted to C:\RAGEMP\server-files as you can see in the screenshot bellow.

Error creating thumbnail: Unable to save thumbnail to destination

Open the bridge folder (C:\RAGEMP\server-files\bridge), right click on settings.xml and Edit with a reliable text exitor (i.e: Notepad++)

Error creating thumbnail: Unable to save thumbnail to destination

Considering this is a clean setup, right beneath <resource src="welcomemessages" /> add the following line: <resource src="myresourcename" />

Error creating thumbnail: Unable to save thumbnail to destination

Save and close the Text editor window.


Now that we have our resources settings set up, we're now going to create the resource folder to where resources source files will reside in.

Which as you can see, under the C:\RAGEMP\server-files\bridge\resources directory, I have created my myresourcename folder.

Error creating thumbnail: Unable to save thumbnail to destination

Go back to C:\RAGEMP\server-files\ directory and launch the server.exe executable so it creates the resource template

Error creating thumbnail: Unable to save thumbnail to destination

You should see the following yellow line in the console myresourcename: 'meta.xml' is missing, creating a default resource template.., this means you've got everything set up correctly so far.

Error creating thumbnail: Unable to save thumbnail to destination

Setting up Visual Studio

Close the server, navigate to the server-files/bridge/resources where all your resources reside and open myresourcename folder.

Error creating thumbnail: Unable to save thumbnail to destination

You should see a .csproj file with your resource name on it (myresourcename.csproj), click twice on it and it should launch with Visual Studio

Error creating thumbnail: Unable to save thumbnail to destination

You should now be able to edit your resource code. once done so, you can save it and launch the server to see it working.

That's it, Happy programing!


Debugging (Breakpoints, Stack traces, etc..)