microsoft / Windows.UI.Composition-Win32-Samples

Windows.UI.Composition Win32 Samples
MIT License
469 stars 186 forks source link

WinForms AcrylicEffect not running #52

Closed DAVIDSystems closed 4 years ago

DAVIDSystems commented 4 years ago

Sample Code will not run:

   public Form1() : base()
    {
        InitializeComponent();

        // Get graphics device.
        **canvasDevice = CanvasDevice.GetSharedDevice();** => This line causes the exception

        // Create effect graph.
        acrylicEffect = CreateAcrylicEffectGraph();
    }

Exception:

System.IO.FileNotFoundException HResult=0x8007007E Message=(Module not found)Das angegebene Modul wurde nicht gefunden. (Ausnahme von HRESULT: 0x8007007E) Source=mscorlib StackTrace: at System.StubHelpers.StubHelpers.GetWinRTFactoryObject(IntPtr pCPCMD) at Microsoft.Graphics.Canvas.CanvasDevice.GetSharedDevice() at AcrylicEffect.Form1..ctor() in G:\Data\Projects\git\c#\SampleCode\Windows.UI.Composition-Win32-Samples\dotnet\WinForms\AcrylicEffect\AcrylicEffect\Form1.cs:line 32 at AcrylicEffect.Program.Main() in G:\Data\Projects\git\c#\SampleCode\Windows.UI.Composition-Win32-Samples\dotnet\WinForms\AcrylicEffect\AcrylicEffect\Program.cs:line 19

The project compiles without problem on VS 2019. I copied also Microsoft.Graphics.Canvas.dll to the debug folder I installed all current updates.

I wonder what file or module can't be found ?

DAVIDSystems commented 4 years ago

After updating all packages it finally runs.

aggiehorns commented 4 years ago

Having same issue, updating packages does nothing for me. I also get same error on the WinForm version of AcrylicEffect project.