Currently, I’m trying to create a VR environment in MonoGame and so I need an API to interface with the headset. I decided to use OpenVR since it works best with Valve headsets like mine. However, I haven’t used any APIs before so I don’t know anything about how to reference them.
The OpenVR documentation is very unhelpful for beginners since the only instructions it gives are initialization instructions that assume that you already have the API attached to your project. I’ve looked online to find instructions on how to reference an API but almost every single tutorial is about how to create one, very unhelpful. The little information I did find on referencing APIs in C# projects led me to the “add project reference” dialogue. However, I managed to run into another roadblock as, upon attempting to add the API’s dll file as a reference, Visual Studio gives an error stating “reference is invalid or unsupported”.
Clearly, there are more steps involved in referencing OpenVR in a C# project that I’m unaware of, but I have no way of learning them. I’ve gone through every readme file in this entire API several times and am no closer to understanding any part of it. No one on the OpenVR or VRdev subreddits, the OpenVR GitHub, or Stackoverflow has responded to my posts in over 2 weeks, leading me to believe that either no one knows how to reference this API in a C# project or my understanding of the issue is so far off the mark that no one can figure out what in the world I’m talking about. so to be clear this is my goal:
I want to reference the OpenVR API in my MonoGame project.
This is the current roadblock:
I cannot figure out how to add the reference. When I try to reference the dll file, Visual Studio gives me the error “reference is invalid or unsupported”. There are no clear instructions in the OpenVR documentation nor elsewhere online on how to reference the API.
This issue is infuriating as I’ve been completely stonewalled on this project and I haven’t even gotten to write any code yet. I feel as though I’ve exhausted every available resource to fix this issue; not even my college professors can tell me what I need to do. I know that what I’m trying to do is possible, there are references (vague and unclear as they may be) in the OpenVR documentation to C# methods, and others here on the MonoGame forums have shared VR projects that are compatible with OpenVR platforms, but I just don’t know how to get there from where I am. If anyone has any info on how to reference this API in a C# project or why the normal route isn’t working it would be greatly appreciated.