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

.NET7 RC2 PrintDocument exception. #77340

Closed
MiyamuraMiyako opened this issue Oct 22, 2022 · 3 comments
Closed

.NET7 RC2 PrintDocument exception. #77340

MiyamuraMiyako opened this issue Oct 22, 2022 · 3 comments

Comments

@MiyamuraMiyako
Copy link

Description

.NET7(x86) PrintDocument will throw AccessViolationException when execute to Print, x64 is ok.

Reproduction Steps

  1. Create new .net7 project and set to x86.
  2. Use below code :
PrintDocument pd = new PrintDocument();
pd.PrinterSettings.PrinterName = "Microsoft Print to PDF";
pd.PrintController = new StandardPrintController();

pd.PrintPage += (sender, e) => { };
pd.Print();
  1. Start program and will throw System.AccessViolationException:“Attempted to read or write protected memory. This is often an indication that other memory is corrupt.”

Expected behavior

Print normally.

Actual behavior

Throw AccessViolationException when execute to Print.

Regression?

No response

Known Workarounds

Downgrade to .NET6 sdk and packages.

Configuration

No response

Other information

No response

@dotnet-issue-labeler
Copy link

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

@ghost ghost added the untriaged New issue has not been triaged by the area owner label Oct 22, 2022
@ghost
Copy link

ghost commented Oct 22, 2022

Tagging subscribers to this area: @dotnet/area-system-drawing
See info in area-owners.md if you want to be subscribed.

Issue Details

Description

.NET7(x86) PrintDocument will throw AccessViolationException when execute to Print, x64 is ok.

Reproduction Steps

  1. Create new .net7 project and set to x86.
  2. Use below code :
PrintDocument pd = new PrintDocument();
pd.PrinterSettings.PrinterName = "Microsoft Print to PDF";
pd.PrintController = new StandardPrintController();

pd.PrintPage += (sender, e) => { };
pd.Print();
  1. Start program and will throw System.AccessViolationException:“Attempted to read or write protected memory. This is often an indication that other memory is corrupt.”

Expected behavior

Print normally.

Actual behavior

Throw AccessViolationException when execute to Print.

Regression?

No response

Known Workarounds

Downgrade to .NET6 sdk and packages.

Configuration

No response

Other information

No response

Author: MiyamuraMiyako
Assignees: -
Labels:

area-System.Drawing, untriaged

Milestone: -

@jkotas
Copy link
Member

jkotas commented Oct 22, 2022

Thank you for reporting the issue. It is duplicate of #76538. The fix will be included in .NET 7.

@jkotas jkotas closed this as completed Oct 22, 2022
@ghost ghost removed the untriaged New issue has not been triaged by the area owner label Oct 22, 2022
@ghost ghost locked as resolved and limited conversation to collaborators Nov 21, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants