Closed
Description
Description
The NuGet package system.resources.extensions.9.0.1.nupkg
references version 9.0.0.0 in its targets file, producing a runtime error that this assembly cannot be found.
Used in a project targeting .NET Framework 4.8.
Reproduction Steps
- Create a .NET Framework 4.8 WinForms project (
TestProject
) -> See PropertyGroup below. - Add a reference to the NuGet package ("Latest stable 9.0.1").
- Add an image resource to the project (
MyImage
). - Add a Button control on the Form (
button1
). - Assign the image resource to the Button control. (
this.button1.Image = global::TestProject.Properties.Resources.MyImage;
in Designer file ). - Run the application
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFrameworks>net48</TargetFrameworks>
<Platforms>AnyCPU</Platforms>
<RuntimeIdentifiers>win-AnyCPU</RuntimeIdentifiers>
<UseWindowsForms>true</UseWindowsForms>
<AppendTargetFrameworkToOutputPath>False</AppendTargetFrameworkToOutputPath>
<GenerateResourceUsePreserializedResources>true</GenerateResourceUsePreserializedResources>
</PropertyGroup>
Expected behavior
The Form opens and displays the Button with the image.
Actual behavior
Exception at the Designer code line above (German OS):
An unhandled exception of type 'System.IO.FileLoadException' occurred in mscorlib.dll
Die Datei oder Assembly "System.Resources.Extensions, Version=9.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51" oder eine Abhängigkeit davon wurde nicht gefunden. Die gefundene Manifestdefinition der Assembly stimmt nicht mit dem Assemblyverweis überein. (Ausnahme von HRESULT: 0x80131040)
Regression?
With version 9.0.0 of this NuGet package it works of course.
Known Workarounds
Use version 9.0.0 of the package.
Configuration
- .NET Framework 4.8
- Windows 10 22H2 (German)
- x64
- Configuration independent (but .NET Runtime dependent)
Other information
Just a forgotten change since the Assembly version has been bumped up (which is probably the fault) but not the targets file.