0

I have a problem when trying to load a signed assembly into my WPF application. Specifically when the WPF Views are created, e.g.

var circularProgressControl = new CircularProgressControl();

I get this error

System.IO.FileLoadException: "Could not load file or assembly 'Projectname, Version=1.5.8615.20370, Culture=neutral, PublicKeyToken=f619059777d70c90' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)"

I could enclose the problem to the point that the signed assembly has this version information:

[assembly: AssemblyVersion("1.5.*")]

It works fine when I don't use the asterisk:

[assembly: AssemblyVersion("1.5")]

Can anyone help with this issue? Is the asterisk incompatible with signed assembly loading or ist this a bug in the environment?

Problem:

[assembly: AssemblyVersion("1.5.*")]

var circularProgressControl = new CircularProgressControl(); --> FileLoadException

No Problem:

[assembly: AssemblyVersion("1.5")] 

var circularProgressControl = new CircularProgressControl(); --> No FileLoadException
Erik Eidt
  • 23,049
  • 2
  • 29
  • 53
cb9980
  • 29
  • 2
  • How are you loading your assembly? with a reference? `assembly.load` ? Do you know precisely what assembly that fails? the *or one of its dependencies*-bit can make debugging quite a bit more complicated. – JonasH Aug 03 '23 at 09:45
  • Not me directly. It's done in the code behind, which I assume will use some basic Windows API functions or so (HRESULT). Yes I know the assembly and I can change the AssemblyVersionInfo but I need to know if the asterisk is allowed or not and if this is maybe a bug? – cb9980 Aug 03 '23 at 09:53

0 Answers0