0

I have to use direct x sdk for my team project. but there's a problem with Microsoft.DirectX.AudioVideoPlayback.

if there are some apis or instructions about directX sdk in project, Whole project is freezed. whole project had no problem before using directX sdk.

in debugging mode, other instruction is passed well. but there was a problem when I access a method that has a directx sdk.

for examle method1 is passed well, but in method2 project is freezed.

//source code 1
public void test(){
      method1();
      method2();  //whole project is freezed here. can't access inside of method.
}
public void method1(){
       //Microsoft.DirectX.AudioVideoPlayback.Video video;
}
public void method2(){
       Microsoft.DirectX.AudioVideoPlayback.Video video;
}

I'm using visual studio 2013 c#. and I success installing and adding to refference about Microsoft.DirectX.AudioVideoPlayback

user3867261
  • 109
  • 1
  • 2
  • 7
  • Please create a complete example that shows the behavior you are experiencing. – nvoigt Jul 23 '14 at 05:35
  • @nvoigt wanna more code??? – user3867261 Jul 23 '14 at 05:52
  • Please have a look at [the help center explanation of a good code example](http://stackoverflow.com/help/mcve). – nvoigt Jul 23 '14 at 06:21
  • The legacy Managed DirectX 1.1 assemblies are only compatible with .NET 2.0, not .NET 4.x. What framework version are you trying to target? See this [blog post](http://blogs.msdn.com/b/chuckw/archive/2010/12/09/directx-and-net.aspx) – Chuck Walbourn Jul 23 '14 at 06:46

1 Answers1

0

I had the same problem as OP, and Google lead me here. I had another problem that was working with DirectX, and I noticed the following in the app.config:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <startup useLegacyV2RuntimeActivationPolicy="true">
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
  </startup>
</configuration>

I am not a "DirectXpert", this program is just a hobby, but the solution appears to be including useLegacyV2RuntimeActivationPolicy="true" in the startup tag. When I added that, my method would execute. Hopefully this will help others.

SouthShoreAK
  • 4,176
  • 2
  • 26
  • 48