S&box Wiki
Home
/
Edit Debugging
View
Edit
History
No Category
Developer Overview
The Project System
Publishing To Asset Party
Getting Started With Hammer
Mapping Basics
Mapping Entities
Advanced Mapping Techniques
Getting Started with Modeldoc
Animgraph & Animation
Physics
Modeldoc Nodes
Advanced Modelling
UI Basics
Styles & Stylesheets
Razor Templates
Game Menus
Materials
Built In Shaders
Shaders
Shader Reference
Sounds & Audio
Particles
Getting Started
Making Games
Input
Networking
Physics
Rendering
Editor & Tools
VR
Misc
Playing Guides
Console Commands & Variables
Dedicated Server
Preview
Log in to edit
Debugging
<cat>Code.Intro</cat> <title>Debugging</title> #Debugging using Visual Studio ##Starting in debug mode S&box supports debugging, it's as simple as opening up the [generated](Your_First_Project#openingyourprojectinvisualstudio) `s&box.sln` and hitting **Debug** > **Start Debugging** ( <key>F5</key> ). This will launch a new instance of s&box and attach a debugger to it. ##Attaching a debugger You can also attach a debugger to an already running instance of the game by going to **Debug** > **Attach to Process** ( <key>Ctrl</key> + <key>Alt</key> + <key>P</key> ) and selecting `sbox.exe` in the list of processes. After this you can reattach the debugger to the same process using **Debug** > **Reattach to Process** ( <key>Shift</key> + <key>Alt</key> + <key>P</key> ). ##Using breakpoints ![Breakpoint](https://files.facepunch.com/wiki/files/a59bc/8d90cbdd54b5728.png) Breakpoints allow you to pause execution when it reaches specified points in your code (breakpoints). To add or remove a breakpoint click on the left from the line of code you want to pause or put the caret on this line and press <key>F9</key>. A red circle should appear and the line should turn red. When this line will be reached execution will pause allowing you to inspect variables values, continue execution step-by-step and more. After you are done press <key>F5</key> to continue execution. Breakpoints can be added and removed freely in runtime, unlike code changes they don't require recompiling. ##Disabling Edit and Continue You may notice that you get green underlines while debugging and editing code, this is due to **Edit and Continue** being enabled in the Visual Studio settings, normally this is a good thing but due to s&box hotloading it needs to be disabled. You can disable this by going to **Tools** > **Options** > (or **Debug** > **Options**) > **Debugging** > **General** then scrolling about half way down and unchecking **Edit and Continue**. #Debugging using Visual Studio Code Refer to [Setting up Visual Studio Code](https://wiki.facepunch.com/sbox/Setting_up_VSCode#addingdebuggerconfiguration) to setup debugging for the time being #Debugging using Rider Refer to [Setting up Rider](https://wiki.facepunch.com/sbox/Setting_up_Rider#debugging) to setup debugging for the time being
S&box Wiki
Development
Developer Overview
6
Editor Overview
General FAQ
System Requirements
The s&box wiki
Troubleshooting
Useful Links
The Project System
4
Adding Assets
Creating a Game Project
Project Settings Window - Games
Project Types
Publishing To Asset Party
2
Uploading assets
Uploading projects
Hammer
Getting Started With Hammer
3
Getting Started With Hammer
Making Your First Map
Mapping Resources
Mapping Basics
7
Cordons
Hotspot Materials
Selection Sets
Standard Mapping Dimensions
Tool Materials
Tools Visualisation Modes
Using Entities That Require a Mesh
Mapping Entities
2
Creating a Door
Light Entities
Advanced Mapping Techniques
8
Collaborating With Prefabs and Git
Instances
Prefabs
Quixel Bridge Plugin
Tilesets
Tilesets-Advanced
Tilesets-Proxies
VIS Optimizations
Models & Animation
Getting Started with Modeldoc
7
Automatic Model Setup
Breakpieces
Creating a Model
Guide to Models
Importing Rust Weapons
LODs
ModelDoc FAQ & best practices
Animgraph & Animation
3
Animations without Animgraph
AnimEvents, AnimGraph Tags, Attachments
Animgraph
Physics
3
Cloth Physics
Collisions, Physics & Surface Types
Jiggle Bones
Modeldoc Nodes
1
Custom ModelDoc nodes
Advanced Modelling
6
Bodygroups
Citizen
First Person
IKChains and Stride Retargeting
Morphs
Vertex Normals
User Interface
UI Basics
6
Custom Fonts
Embedding Websites
Enabling Pointer Events
Events and Input
Localization
UI Basics
Styles & Stylesheets
2
Custom Style Properties
Supported Style Properties
Razor Templates
3
A Razor Overview
Generic Components
Templates
Game Menus
0
Materials & Shaders
Materials
5
Guide to Materials
Material Attributes
Material Resources
Texture Settings
Using Dynamic Expressions
Built In Shaders
2
Foliage Shader
Glass Shader
Shaders
4
Compute Shaders
Constant Buffers
Material API
Shading Model
Shader Reference
4
Anatomy of Shader Files
Shader Reference
Shader States
Texture Format Cheat-Sheet
Other Assets
Sounds & Audio
3
Guide to Sounds
Sound Events
Soundscapes
Particles
5
Creating animated sprites
Creating your first particle effect
Understanding Particle Editor
Using custom sprites
Using particle systems from C#
Coding
Getting Started
6
Cheat Sheet
Debugging
Learning Resources
Setting up Rider
Setting up Visual Studio
Setting up Visual Studio Code
Making Games
2
Components
GameObjects
Input
4
Commands
ConVars
Input System
Speech Recognition
Networking
7
Auth Tokens
Http Requests
Networked Types
Networking Basics
RPCs
Setting Up Networking
WebSockets
Physics
4
Collisions
Hitboxes
Traces
Triggers
Rendering
3
Render Tags
RenderHooks
Scenes
Editor & Tools
7
Creating a Tool
Custom Asset Types
Guide to Widgets
Hammer API
Hammer Gizmos
Hotload Performance
Widget Docking
VR
3
Getting Started
VR Input
VR Overlays
Misc
13
Asset Types
Attributes and Component Properties
Backend API
Cloud Assets in code
Code Accesslist
CPU Performance Profiling
DisplayInfo
FileSystem
Mounting assets at runtime
package/find
Setting Up A Navigation Mesh
Threaded Tasks
TypeLibrary
Playing
Playing Guides
3
Default Keybinds
Proton
s&box on macOS (Experimental)
Console Commands & Variables
1
Launch Arguments
Dedicated Server
1
Dedicated Servers