You can try debugging directly on your server, however, your server might not have all the C# and Web development features configured in Visual Studio. Most servers have the basic Visual Studio features turned on. You'll find some simple steps posted here (relevant for Visual Studio 2017 and higher). You might want to upgrade your Visual Studio first so that it can handle Razor and newer code.