0

In form1 designer I have menustrip with Open menu.

Just dragged from toolbox menustrip added Open menu.

when running the program and clicking the Open I can't use a break point it's not even get there but throw this exception first:

Could not load file or assembly 'Microsoft.DirectX.AudioVideoPlayback.dll' or one of its dependencies. is not a valid Win32 application. (Exception from HRESULT: 0x800700C1)

The exception is in Program.cs on the line

Application.Run(new Form1());

Not sure what is going on here. Maybe something messed up with the designer ? My project is set to .net 4.5 and to Any CPU I tried to set it to .net 4 and to x86 but same exception.

Ghasem
  • 14,455
  • 21
  • 138
  • 171
Daniel Voit
  • 111
  • 1
  • 10
  • Try: http://stackoverflow.com/questions/22915120/system-io-fileloadexception-could-not-load-file-or-assembly-microsoft-windowsa – Idos May 08 '16 at 08:14
  • 1
    [Check out Hans Passant's answer here.](http://stackoverflow.com/a/26329259/106159) You might want to start using [SharpDX](http://sharpdx.org/) instead. – Matthew Watson May 08 '16 at 08:23
  • Ok I managed to fix it I guess by adding another version of the Microsoft.DirectX.AudioVideoPlayback.dll to my project and also set the app.config file I added to the file the line: useLegacyV2RuntimeActivationPolicy="true" also set the target to x86(but not sure not tested if x86 is a must) – Daniel Voit May 08 '16 at 13:52

0 Answers0