Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WinAppSDK v1.1.0 throws System.AccessViolationException on Unpackaged WinUI 3 apps #2578

Closed
AndrewKeepCoding opened this issue Jun 5, 2022 · 6 comments
Assignees
Labels
bug Something isn't working

Comments

@AndrewKeepCoding
Copy link

Describe the bug

Unpackaged WinUI 3 apps throw System.AccessViolationException at the very start you run the app.

Steps to reproduce the bug

  1. Create a WinUI 3 app from Blank App, Packaged (WinUI 3 in Desktop).
  2. Add <WindowsPackageType>None</WindowsPackageType> to the csproj file.
  3. Change the debug property to [projectname] (Unpackaged).
    • The app runs (Debugger or the EXE file) without problems to this point.
  4. Update WinAppSDK NuGet package to v1.1.0.
  5. Run the app (F5) but you get the exception.

Expected behavior

Runs without exceptions or errors.

Screenshots

image

NuGet package version

No response

Packaging type

Unpackaged

Windows version

Windows 11 version 21H2 (22000)

IDE

Visual Studio 2022

Additional context

No response

@AndrewKeepCoding
Copy link
Author

By the way, the Issue: Bug report form has no 1.1.0 option in the NuGet package version list.

@rocksdanister
Copy link

rocksdanister commented Jun 5, 2022

I had the same problem, uninstalling preview WinAppSdk fixed it for me:

microsoft/PowerToys#18603 (comment)

or setting WindowsAppSDKSelfContained to true.

@AndrewKeepCoding
Copy link
Author

I haven't installed any WinAppSDK preview packages, but at least setting WindowsAppSDKSelfContained to true worked for me. Thanks!😊 But I think this is a bug, so I'll keep it open and let the team close it.

@aepot
Copy link

aepot commented Jun 29, 2022

Uninstalled everything related to Windows App SDK using PowerShell, then installed 1.1 from website with the latest installer.

NuGet Package 1.1.0 works fine.
But 1.1.1 fails to start because AccessViolationException as described int the initial post.

<WindowsAppSDKSelfContained> doesn't work for me because Visual Studio 2022 failed to publish the app with this option but debug mode worked fine.

Downgrading Microsoft.WindowsAppSDK NuGet Package to 1.1.0 solved the problem.
So the 1.1.1 Package seems to be broken.

Windows 11 21H2

@mikebattista
Copy link

Just confirmed this is fixed in 1.1.2 shipping soon.

@AndrewKeepCoding
Copy link
Author

AndrewKeepCoding commented Jul 2, 2022

@mikebattista Thank you!😎

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants