S&box Wiki

Revision Difference

Setting_up_Visual_Studio#546325

<cat>Code.Intro</cat> <title>Setting up Visual Studio</title> ⤶ <note>If you already have Visual Studio installed, make sure you have the latest version of Visual Studio 2022.</note>⤶ # Downloading and installing Visual Studio 2022 [Download Visual Studio 2022 Community](https://visualstudio.microsoft.com/downloads/) and install with the workload .NET desktop development. If you need additional guidance refer to the [official guide](https://docs.microsoft.com/en-us/visualstudio/install/install-visual-studio?view=vs-2022). ⤶ ⤶ # Generating your solution⤶ ⤶ A solution file is automatically generated when you launch the game, you can find this solution next to your game directory.⤶ ⤶ ```⤶ C:/Steam/steamapps/common/sbox/s&box.sln⤶ ```⤶ ⤶ <upload src="a5727/8d9398753b3da50.png" size="8056" name="image.png" />⤶ ⤶ This is a solution file you can open in Visual Studio, this solution contains all your addons as projects.⤶ ⤶ <upload src="a5727/8d939875bdc9091.png" size="10341" name="image.png" />⤶ ⤶ Each time you <page text="create a new addon">Making_Gamemode</page> you will need to restart your game to re-generate the solution.⤶ ⤶ # Opening your projects⤶ ⤶ The easiest way to get started is to press Open Visual Studio from the editor.⤶ ⤶ <upload src="a5727/8d9de7f4090be9e.png" size="4523" name="image.png" />⤶ ⤶ <upload src="a5727/8d9de7fa5b163a6.png" size="3863" name="image.png" />⤶ ⤶ Your solution contains every code addon (games, tools) - everytime you create a new addon it'll be automatically regenerated. # Troubleshooting * If you get a lot of errors from dependencies not being able to load, make sure you have the latest version of Visual Studio installed. * If you get a lot of errors from dependencies not being able to load, make sure you have the latest version of Visual Studio 2022 installed with .NET 6. # Community Extensions * [s&box Tools](https://marketplace.visualstudio.com/items?itemName=rtm516.sboxtools) (Adds some of the features in the external console to the IDE) # Debugging For info on debugging check out the <page>Debugging</page> page.