-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
System.AccessViolationException thrown by PrintDocument.Print when platform is X86 #76538
Comments
Tagging subscribers to this area: @dotnet/area-system-drawing Issue DetailsDescriptionPrintDocument.Print works fine for x86 builds with .NET 6.0.9 but throws exception in .NET 7 RC1. This only happens if the platform is x86. Reproduction StepsCreate new WPF desktop application. Change csproj so it looks like this:
Add a button to MainWindow and change MainWindow.xaml.cs so it looks like this:
Expected behaviorText should be printed to file selected by Microsoft Print to PDF printer. Actual behaviorException thrown on the line Regression?Works fine in .NET 6. Known Workaroundsnone Configuration
The problem only happens on .NET 7 with x86 platform target. Tested on Windows build 25211.1001. The machine architecture is x64. Other informationNo response
|
Tagging subscribers to this area: @dotnet/interop-contrib Issue DetailsDescriptionPrintDocument.Print works fine for x86 builds with .NET 6.0.9 but throws exception in .NET 7 RC1. This only happens if the platform is x86. Reproduction StepsCreate new WPF desktop application. Change csproj so it looks like this:
Add a button to MainWindow and change MainWindow.xaml.cs so it looks like this:
Expected behaviorText should be printed to file selected by Microsoft Print to PDF printer. Actual behaviorException thrown on the line Regression?Works fine in .NET 6. Known Workaroundsnone Configuration
The problem only happens on .NET 7 with x86 platform target. Tested on Windows build 25211.1001. The machine architecture is x64. Other informationNo response
|
AV at:
Looks like a bug in the LibraryImportGenerator refactoring. DOCINFO argument needs to be passed in as |
@jkoritzinsky can you have a look as it seems caused by ccd67b0#diff-0004b77bd28bade5f8de26f55217352ec12d8af3c7de3d2c344f8e4ff8c38cebR51 Given we don't have 100% coverage of all of System.Drawing.Common I wonder if we should audit the generator conversion for other mistakes - or revert it for that assembly. cc @JeremyKuhne |
Closing via #76582 |
Description
PrintDocument.Print works fine for x86 builds with .NET 6.0.9 but throws exception in .NET 7 RC1. This only happens if the platform is x86.
Reproduction Steps
Create new WPF desktop application.
Change csproj so it looks like this:
Add a button to MainWindow and change MainWindow.xaml.cs so it looks like this:
Expected behavior
Text should be printed to file selected by Microsoft Print to PDF printer.
Actual behavior
Exception thrown on the line
doc.Print();
Regression?
Works fine in .NET 6.
Known Workarounds
none
Configuration
The problem only happens on .NET 7 with x86 platform target.
Tested on Windows build 25211.1001. The machine architecture is x64.
Other information
No response
The text was updated successfully, but these errors were encountered: