Search code examples
c#resx

What is the assembly element in resx files for?


The program I'm working on reads ResX files and it fails to read this one particular resx file that has two assembly elements for the same name.

ex.

<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />

<assembly alias="System.Windows.Forms" name="System.Windows.Forms">

are in the same resx file. When parsing the data element below the latter assembly a System.TypeLoadException is thrown. When I delete the latter one, there is no exception thrown.


Solution

  • That's clearly an error/problem, though it's hard to know how it got there without more info. Remove the second (not fully-qualified) assembly definition, and all should work fine.