microsoft / Windows.UI.Composition-Win32-Samples

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

ScreenCapture sample fails to compile #82

Closed GrantMeStrength closed 1 year ago

GrantMeStrength commented 3 years ago

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

robmikh commented 3 years ago

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