Error using toolbox with managed C++

Dec 19, 2013 at 11:40 PM
Edited Dec 19, 2013 at 11:43 PM
I have a managed C++ WinForm application that I am trying to drop a plot into. When I do so, I get the following error dialog:
---------------------------
Microsoft Visual Studio
---------------------------
Value does not fall within the expected range.
---------------------------
OK   
---------------------------
Helpful, right?

I am using the latest .NET 4.5 binaries. I added the plot control to the toolbox manually by browsing for OxyPlot.WindowsForms.DLL.

Any ideas? Is there any other information from me that would be helpful?
Dec 20, 2013 at 4:16 PM
Edited Dec 20, 2013 at 4:17 PM
Figured it out. I wasn't able to add the winforms class library to the project references because my project was targeting .NET version 4.0. It will add the core OxyPlot library, but it will throw an error when you try to reference the winforms DLL.

You have to manually set the project's targeted framework to version 4.5. You do this by manually editing the project file and adding <TargetFrameworkVersion>v4.5</TargetFrameworkVersion> to the globals section.

Once you've done this, you'll actually be able to reference all of the required class libraries and the toolbox will now be usable.