dotnet / upgrade-assistant

A tool to assist developers in upgrading .NET Framework applications to .NET 6 and beyond
MIT License
1.11k stars 163 forks source link

Winforms .NET 4.8 application conversion does not automatically include EmbeddedResourceUseDependentUponConvention property #1569

Open abrguyt opened 5 months ago

abrguyt commented 5 months ago

Using the VS Upgrade Assistant on a fairly large Winforms .NET 4.8 project I noticed that the Upgrade Assistant does not automatically include the property in the project file:

<EmbeddedResourceUseDependentUponConvention>true</EmbeddedResourceUseDependentUponConvention>

When having Forms where the class name of the Form differs from the filename for the form.cs + .resx file, the .resx file does not get properly embedded and compiled with the correct namespace, leading to a MissingManifestResourceException exception when the Form in question is instantiated.

Adding the aforementioned property manually solves the problem. It would save a lot of time when this property would be included automatically for Winforms projects.

I got hinted at this solution by https://github.com/dotnet/winforms/issues/638