I want to add the Oxide/Rust Reference to Visual Studio
YES I KNOW THERE ARE A LOT OF THREADS THAT ARE SHOWING HOW TO DO THAT but there is no clear tutorial or sth like that..
I saw the Vilsols tutorial but i dont have the thingy on the right and it was showing the same message(step4)
So i will tell you what i am doing right now:
1. http://screenshot.sh/ofnyk5PCCoIoM my Visual Studio 2015
2. I got to: Project -> Add reference and i select the Assembly-Csharp, Oxide.Core, Oxide.Game.Rust, UnityEngine, Oxide.Ext.CSharp and some more.
3. Okay i'm adding the references to my code so it should look like:
using Oxide.Core;
using Oxide.Game.Rust;
using UnityEngine;
4. Then there is a yellow line with a "lamp" which says http://screenshot.sh/mGR97FmDn5oJi
5. RIP Any ideas?
Solved Adding references in Visual Studio?
Discussion in 'Rust Discussion' started by PaiN, Aug 3, 2015.
-
Wulf Community Admin
Clone the Oxide GitHub repo, open it in Visual Studio, create or move your plugin in the Oxide.Game.Rust/Plugins folder, done.
-
So yeah i dont know anything about github even if i have my own..(Yeah i know no comment)
How do i clone the Oxide GitHub repo xD? -
Wulf Community Admin
-
Sorry for all these questions but i tried so many times and this time it must work.. -
Wulf Community Admin
-
So now the auto completion should work right ??
Because when i type HitInfo or hitinfo it doesnt show me a list or sth like that.
My Visual Studio look like http://screenshot.sh/mK7yZCA8Gv3ok it shows the Oxide at the top so that a progress xD
You said "create or move your plugin in the Oxide.Game.Rust/Plugins folder"
Create.. but what to create there are too many options http://screenshot.sh/mKLWweAGocZ78 .... i'm lost -
PaiN,
It looks like you do not have the default layout for VS, normally when you have a project open you should see on the right a dockable pane that includes the project explorer on top and the properties explorer on the bottom. You don't want to close these, they are your bread and butter! Browse through the view menu and put these back, they are vital.
You do not need to put the CS files in any particular place for the dev, the thing about "create or move your plugin in the oxide/plugsins folder" is for when you are done and want to publish it. I have one project for all my plugins myself and they are all in the same folder as the .csproj file.. You can create new classes by right-clicking on the project root on the Project Explorer (top right) and do Add -> New Class. This will create a template class, you can just delete whatever is in there and add code from a random plugin you have and just strip it down to the namespace/class def and rename the class in there to match the filename.
As for the hitInfo, if you are in a valid class/function body, you can do something like:
"var a= new Hit" and as you type, VS should propose classes that are loaded and match "Hit" and "HitInfo" should pop in there. If it does not, then you are missing References (see my PM) and/or a "using" statement at the beginning of the class to specify to VS that you want to use this or that reference.
Once you've finished your line (var a= new HitInfo() you should be able to just type a. and the properties/members of HitInfo should pop right at you, allowing you to browse them.. -
-
Okay works perfectly.. thanks everyone for the help!
-
-
Wulf Community Admin
-
-
Wulf Community Admin
I wasn't saying your way doesn't work, the way I was saying is a valid method as well. Not referring to the oxide/plugins folder of your server either. -
-
Wulf Community Admin
-
Ok so basically you are injecting code in the Dll?
-
Wulf Community Admin