I have an executable called ess.exe
. I generate an XmlSerializer DLL for it using sgen.exe
, and when I run it, it picks up the generated ess.XmlSerializers.dll
and all is well.
I also have a DLL called EntrianSourceSearch_14.dll
, which is loaded dynamically using Assembly.LoadFrom(DllPathname)
. If I generate an XmlSerializer DLL for that DLL, it doesn't pick up the generated DLL; instead it falls back to runtime generation of the XML serialization code.
How do I get my DLL to pick up its corresponding generated XmlSerializer DLL?
Edit: I can't put the XmlSerializer DLL into the executable's directory because my DLL is part of a Visual Studio extension - the executable is Visual Studio (devenv.exe), and copying pieces of my product into its directory would probably be seen as anti-social. :-)
Edit to add more context: This is a Visual Studio add-in and extension. It works with all versions of Visual Studio from 2005 to 2017. The bulk of the code is installed into Program Files, and older versions of Visual Studio simply load it from there as an add-in. For newer versions of Visual Studio, which don't support add-ins, there is an extension which is just a loader for those main components in Program Files. That extension uses LoadFrom
to load those main components, one of which is EntrianSourceSearch_14.dll
.