Working on a large Winforms project with many custom controls containing custom properties. The C# project with the controls is strongly-named. I have been unable to remove the signature or change the assembly, class, or namespace in any way without breaking all consuming forms.
Sample to reproduce:
[TypeConverter(typeof(ExpandableObjectConverter)), Serializable]
public class InnerDetails
{
public int DogYears { get; set; };
}
public partial class Component1 : Control
{
public Component1()
{
InitializeComponent();
}
public InnerDetails InnerDetails { get; set; } = new InnerDetails();
}
Reference Class library by another WinForms assembly.
Drag/drop Component1 onto a form
AAEAAAD/////AQAAAAAAAAAMAgAAAFBDbGFzc0xpYnJhcnkxLCBWZXJzaW9uPTEuMC4wLjAsIEN1bHR1 cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49ZDFjMmE5YmVlMThkOTZlNwUBAAAAGkNsYXNzTGlicmFy eTEuSW5uZXJEZXRhaWxzAQAAABk8RG9nWWVhcnM+a19fQmFja2luZ0ZpZWxkAAgCAAAABgAAAAs=
At this point all builds and works well
Now remove signing from Class Library, or modify any part of the strong name (assembly name, class, namespace...)
error MSB3103: Invalid Resx file. Could not load file or assembly 'ClassLibrary1, Version=1.0.0.0, Culture=neutral, PublicKeyToken=d1c2a9bee18d96e7' or one of its dependencies. A strongly-named assembly is required. (Exception from HRESULT: 0x80131044) Line 126, position 5.
Manually deleting RESX nodes generates a different error and seems to risk losing configuration data.
There are several dozen forms with this, each containing 4-12 nodes.
I am now experimenting with Base64-decoding but would appreciate any better alternatives.
User contributions licensed under CC BY-SA 3.0