1

I have a Windows Forms Control Library called "UserControlTest" (I'm practicing with it right now) and I am trying to use some of the AForge Libraries Controls on it. It lets me put them on the design and doesn't have any errors after building the solution, but when I try to run it it says

Failed to create UserControl 'UserControlTest.UserControl1'

The error message was 'Could not load file or assembly 'AForge.Video, Version=2.2.5.0, Culture=neutral, PublicKeyToken=cbfb6e07d173c401' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515')

I need the AForge libraries for this particular user control, but there is this problem. I want the libraries in the user control because I need to programmatically create this user control 2 or 3 times (sometimes more, sometimes less, so it needs to be dynamic). Is this not possible? I thought it would still work since it is still a windows form. I can show my code, but I don't think that would help since there are no errors in the code.

Community
  • 1
  • 1
user3634308
  • 119
  • 1
  • 3
  • 14
  • AForge.NET should work with Windows Forms. Are you using NuGet to add the references? Which version of .NET Framework are you targeting? – Anders Gustafsson Sep 16 '14 at 10:39
  • I'm using .NET 4.0 and Visual Studio 2010. Using NuGet to add the references? I do Project>Add References... I don't think AForge works in UserControls. I'm wondering if someone knows for sure though. – user3634308 Sep 17 '14 at 15:27
  • 1
    I recommend that you use NuGet to reference the required AForge packages; NuGet takes care of any third-party dependencies for you. If you are using VS 2010, please see [here](http://docs.nuget.org/docs/start-here/installing-nuget) for info on how to install the NuGet plug-in. Once you have NuGet installed, use the NuGet package manager to locate the online [AForge packages](http://www.nuget.org/profiles/aforge.net) and download them to your project. As I stated previously, AForge should work seamlessly with Windows Forms, most likely you are missing a third-party reference. – Anders Gustafsson Sep 17 '14 at 19:38

0 Answers0