Jul 1, 2010 at 7:01 AM
Edited Jul 1, 2010 at 7:03 AM
I'm trying to write a simple VST host using VS C# Express 2010. I don't own the full studio because it's a bit pricey -- I'm trying to get away with just using the free Express editions. I realize that's asking for trouble, but I'm trying for it anyway!
Here's what I did:
1) Created a new project which referenced the Release versions of the Core, Framework, and Interop binaries available for download from the site.
2) Copied a bunch of code from the VST host sample (specifically, the OpenPlugin function, the HostCmdStub_PluginCalled function, and the entirety of HostCommandStub.cs). I was hoping to just load a plugin as a first step.
When running the application, I get the following error:
Mixed mode assembly is built against version 'v2.0.50727' of the runtime and cannot be loaded in the 4.0 runtime without additional configuration information.
This seems self-explanatory (ish). It would appear as if the dlls were built against an older version of the .NET framework. I'd guess VS2008 because that seems to be what's recommended. This implied to me that I would need to rebuild the Core, Framework,
and Interop dlls from source.
This was an immediate problem because the source code solution contains references to multiple types of projects (.csproj, .vcproj). The Express edition won't allow me to open a single solution containing multiple types of projects - I can load the Interop
vcproj into Visual C++ Express 2010 and the Core and Framework into Visual C# 2010, but I can't load both at once. After some wrangling, I created two separate solutions -- one for the C# stuff and another for the C++ Interop. I was able to successfully compile
the Core and Framework dlls. I couldn't seem to get a Debug build to go, but that's the least of my worries right now.
So then I moved on to Interop. When I try to build the project I get literally thousands of errors. It seems like it's not properly recognizing the required Core and Framework stuff. Here's the first error I receive:
... vst.net\code\jacobi.vst.interop\plugin\HostCommandStub.h(11): error C3083: 'Core': the symbol to the left of a '::' must be a type
That implies to me that it's not recognizing the namespaces exposed in the Core and Framework dlls. I tried to add the following using statements to include those references in the C++ project:
Depending on where I place the using statements, I get different errors. I tried placing them just below #include <stddef.h> in stdafx.h hoping that would apply it across the files. I get the error:
... vst.net\code\jacobi.vst.interop\stdafx.h(15): fatal error C1190: managed targeted code requires a '/clr' option
Now I checked the project settings, and /clr is turned on already, so this error makes no sense to me. That's where I'm stuck -- trying to build the Interop dll to reference in my actual project so that I don't get the version mismatch. Phew!
If you stuck with me all this way, do you have any suggestions?!
Thanks in advance for any help you can provide!