dotnet / dotnet/winforms

Follow-up on 'Constructor on type 'System.Drawing.Image' not found' crash in .NET Core – Provided Sample Not Runnable

Open
#12,435 3 comments 0 reactions 1 assignee Claimed by @Tanya-Solyanik View on GitHub
area-VSDesigner
Dominant language
C#
Stars
4.9k
Forks
1.1k
Avg merge
1d 13m
Merged PRs (30d)
85

Description

### Environment

Microsoft Visual Studio Professional 2022 (64-bit) - Preview
Version 17.12.0 Preview 5.0

### .NET version

NET 9.0

### Did this work in a previous version of Visual Studio and/or previous .NET release?

No

### Issue description

In a .NET Core project, when attempting to add an item as an image in the ImageCollection Editor via the Properties window, this error is encountered. This issue does not occur in the .NET Framework project.

Previous Forum Thread: https://github.com/dotnet/winforms/issues/10549

Current Situation: In response to our initial query, a sample was provided to help resolve the issue. However, the sample is not in a runnable state; it produces additional errors when we attempt to execute it. Screenshots of these errors are attached to this post for your reference.

Request for Assistance: Could someone from the support team review the sample provided in the original query and, if possible, provide an updated, runnable version? Alternatively, any guidance on resolving this issue within the .NET Core project would be greatly appreciated.![Image](https://github.com/user-attachments/assets/207fa248-eb9c-41a7-a847-89dcbbb70bb4)
![Image](https://github.com/user-attachments/assets/0a2cad79-13a3-44fe-9371-9a1afe8b6db6)

### Steps to reproduce

1.Download the sample provided in the previous thread.
2.Open the solution in Visual Studio.
3.Attempt to build or run the project.

Observed Behavior: Errors appear in the Solution Explorer related to the NuGet package references, preventing the solution from building or running. Unfortunately, we’re unsure how to resolve these reference issues, as all necessary NuGets are already referenced in the sample.

### Diagnostics

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.