project freeze when build in c# project using direct x sdk

543 Views Asked by At

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

1

There are 1 best solutions below

0
On

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.