question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

AccessViolationException thrown when updating bindings

See original GitHub issue

Describe the bug In certain scenarios, bindings to .NET objects cause AccessViolationExceptions to be thrown within the binding system, seemingly related to string corruption when marshaling? It seems to be possible at any time but appears to occur most often in ListViews with large amounts of items and string bindings, where the contents of each ListViewItem is it’s own control.

Steps to reproduce the bug Create a ListView populated with a large amount of items with large amounts of string bindings, and scroll through the view by dragging the scroll bar as fast as possible.

See the repo repository here: https://github.com/WamWooWam/WinUIBugRepros/

Expected behavior The app doesn’t crash

Version Info

NuGet package version: Microsoft.WinUI 3.0.0-preview3.201113.0

Windows app type:

UWP Win32
No Yes
Windows 10 version Saw the problem?
Insider Build (19042) Yes
May 2020 Update (19041)
November 2019 Update (18363)
May 2019 Update (18362)
October 2018 Update (17763)
April 2018 Update (17134)
Fall Creators Update (16299)
Creators Update (15063)
Device form factor Saw the problem?
Desktop Yes
Xbox
Surface Hub
IoT

Additional context This could be a CSWinRT related issue, but I haven’t been able to repro this elsewhere

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
sonnemafcommented, Dec 14, 2020

Any news on this. It is a blocking feature for me. I can’t really use WinUI 3.0 preview 3 due to this.

0reactions
evelynwu-msftcommented, Jan 30, 2021

Thanks for the report! The fix for this will be included in the next WinUI 3 Preview. In the meantime, you can work around this issue by installing .NET SDK >= 5.0.101 and adding the following lines to your project file:

  <ItemGroup>
    <FrameworkReference Update="Microsoft.Windows.SDK.NET.Ref" RuntimeFrameworkVersion="10.0.19041.12" />
    <FrameworkReference Update="Microsoft.Windows.SDK.NET.Ref" TargetingPackVersion="10.0.19041.12" />
  </ItemGroup>
Read more comments on GitHub >

github_iconTop Results From Across the Web

AccessViolationException Class (System)
An AccessViolationException exception is always thrown by an attempt to access protected memory -- that is, to access memory that is not allocated...
Read more >
[BUG] `System.AccessViolationException` thrown when ...
Description I am using GLFW for creating a window and SkiaSharp to draw to that window's OpenGL context. SkiaSharp suddenly throws System.
Read more >
Re: AccessViolationException fatal error, Acrobat
I can't deploy an application to production if it will crash on Tab keypress. Platform: Windows 7, 32bit, all current updates. Acrobat 9...
Read more >
System.AccessViolation
AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt. at SFML.
Read more >
System.AccessViolationException with most recent .Net ...
Translation for the German error Message: Tried to read/write in protected memory. Most often this is a hint that memory is corrupted. We...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found