Hi, @watson128. There's some disparity between your screenshot and the topic that you link to. So here's what I did:
Your screenshot is showing the source code for the PhotoEditor sample app. So I cloned and built that sample, and it works fine. I don't get an exception on the line of code that you highlight.
Your issue description mentions a thing called "PhotoViewer". I'm not aware of a sample with that name. But you link to the "Tutorial: Create a simple photo viewer with WinUI 3" topic (which builds a project named SimplePhotos, which seems to be the name of your project). I followed all of the steps in that tutorial from top to bottom, and everything worked as expected.
Type of issue
Code doesn't work
Feedback
I have copied the instructions to develop the C# Windows SDK app, PhotoViewer. I have completed all the instructions but when I run the app I get:![image](https://github.com/MicrosoftDocs/windows-dev-docs/assets/171358509/b7a5a398-b70d-4864-ab8a-a8f0fa9a700d)
Page URL
https://learn.microsoft.com/en-us/windows/apps/get-started/simple-photo-viewer-winui3?tabs=cs
Content source URL
https://github.com/MicrosoftDocs/windows-dev-docs/blob/docs/hub/apps/get-started/simple-photo-viewer-winui3.md
Author
@stevewhims
Document Id
51e8cf41-f09a-864d-26de-66d17727ebfc