Hello,
I am not very familiar with Visual Studio and I was wondering if there is a way to compile the code for the plugin I am writing while still in Visual Studio and not having to copy the plugin into the plugins folder on the server, then read the console output if the code has code errors.
I downloaded the solution off github and opened the Oxide solution in visual studio, then created a new file in the plugins folder (RustOxide\Oxide.Game.Rust\Plugins\Trading.cs) am I missing some important step to get it working as it should?
Thanks.
Solved Compiling the plugin in Visual Studio?
Discussion in 'Rust Development' started by Carbonade, Jul 12, 2015.
-
Wulf Community Admin
If you are having errors compiling, check the output log in Visual Studio and it will tell you what is wrong or missing.
-
I don't think you'll be able to run and debug it locally but you can definitely compile locally to make sure it's going to at least compile and load remotely.
-
I had set the output type of the project to "Class Library" instead of "Console Application". I switched it and now it is printing out errors in the Visual Studio console. -
-
-
Oh I see you were trying to execute the build instead of just compiling. You cannot execute a classlib on it's own, it needs to be loaded by an EXE to work. That said you don't need to run the plugin to check if it compiles, simply do CTRL-SHIFT-B to build and check the build log for errors.
I don't know if other plugin dev's have been able to actually run code from a plugin offline.. I tried just for fun with no success, I get errors when I try to instantiate the plugin. -
So I've previously just been using Notepad++ for creating my own personal plugins, with success, however decided to try to move to Visual Studio seeing as I'm used to using Eclipse for all my Java coding and hate using Notepad++ for it, real IDE's are a lifesaver. However, whenever I try to build my plugins with VS2015 I get an error that no static main method was found, which obviously it's not because the plugins don't require a main method. I can't work out how to compile within VS2015 without getting this error, any ideas?
Apologies for digging up a year-old thread, I thought it might be better than starting yet another thread on setup issues.
EDIT: Nevermind, worked out that's a project error, if I just change the error list to Current Document/Open Documents it works just fine for me. I'll leave this here in case anyone wonders the same in the future.
Thanks,
Alex -
Wulf Community Admin
-
-
Wulf Community Admin
-
though I'd say something like Sublime is a great middle ground, still get a lot of great IDE features without the huge download of VS2015