I've asked this same question on Stack Overflow but thought I'd try here too.
I'm having a strange issue with Unity not resolving my named instance when I build my solution in Release configuration with the optimize code setting checked.
I've enabled fusion logging and it doesn't seem to be an assembly binding issue.
I've opened the compiled assembly using a decompiler and the class seems to be there so it;s not being optimised out because it's not referenced anywhere.
The assembly reference seems okay because my application doesn't throw any errors when it's trying to register the class with the container.
I'm not sure what else to check.
This is how I register the dependencies.
// these updaters are one assembly with lots of other code, they're resolved okay
// this updater is in an assembly with nothing else in it
This is how they are resolved
updater = this._container.Resolve<IClientUpdater>(client.Name);
A few last things to add, this only seems to happen in IIS. IIS Express seems to work fine.
I do get an assembly binding error for an assembly which the RutlandUpdater depends on but the MayriseUpdater also depends on the same one and works okay so I think this might be a red herring.