microsoft/Windows.UI.Composition-Win32-Samples

ScreenCapture sample fails to compile

Closed this issue · 1 comments

  • Downloaded sample file, and unzipped.
  • Opened /dotnet/WPF/ScreenCapture with latest Visual 2019

Build fails.

Severity Code Description Project File Line Suppression State
Error CS0006 Metadata file 'C:\Users***\Downloads\Windows.UI.Composition-Win32-Samples-master\Windows.UI.Composition-Win32-Samples-master\dotnet\WPF\ScreenCapture\Composition.WindowsRuntimeHelpers\bin\Debug\netstandard2.0\Composition.WindowsRuntimeHelpers.dll' could not be found CaptureSampleCore C:\Users\jken\Downloads\Windows.UI.Composition-Win32-Samples-master\Windows.UI.Composition-Win32-Samples-master\dotnet\WPF\ScreenCapture\CaptureSampleCore\CSC 1 Active

Hmmm, I just pulled down a new copy and was able to build the sample. I'm guessing you have all the prerequisite Visual Studio features installed (e.g. UWP, C#, Desktop development, .NET Framework)? Do you have anything more from the log that you can share? Did the other components fail to build or can the main project not find them?

The first thing I would try is to build the runtime helpers project separately, then the sample core, and then the sample itself.

Alternatively, does this version of the sample work for you? It's based on .NET 5 instead of using .NET Framework:
https://github.com/robmikh/WPFCaptureSample