2

I have a c# BHO taht uses CML Serialization. To avoid IT to prompt for csc.exe to generate the assembly for serialization, I've created My.App.XmlSerializers.dll as part of the build using sgen. But My.App.dll fails lot load My.App.XmlSerializers.dll:

LOADED ASSEMBLIES:
My.App, Version=1.0.0.0, Culture=neutral, PublicKeyToken=615a444ac04be6dd

FirstChanceException event raised in DefaultDomain: Could not load file or assembly 'My.App.XmlSerializers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=615a444ac04be6dd' or one of its dependencies. The system cannot find the file specified. - C:\MyPath\bin\Debug\My.App.dll

I've done a lot of research, and I have verified that:

  • both DLLs are in the same folder
  • both DLLs are signed using the same strong key

I don't understand why My.App.XmlSerializers.dll is not found or not loadec correctly.

Julien
  • 5,729
  • 4
  • 37
  • 60

1 Answers1

0

This link will give you solution: What is MyAssembly.XmlSerializers.dll generated for? You have 3 options:

  1. change build opions: GenerateSerializationAssemblies to Off
  2. rename "Assembly Name" to same as "Default Namespace" in "Application" tab of project properties
  3. use AppDomain.CurrentDomain.AssemblyResolve event, you can find example here: how to update assemblyBinding section in config file at runtime?
Dongdong
  • 2,208
  • 19
  • 28