We had one of our programmers make some changes that really don’t make sense to anyone and i’m hoping someone can provide some insight.Unfortunately we are unable to contact him until next week but it would be nice to know this info sooner.
We have a custom application loader (built in .net) that downloads all appropriate source files and registers/unregisters dlls that are COM and runs RegASM for some assemblies. We had problems with the loader under windows 7 (x64) which he was assigned to correct.
The only thing that the individual assigned to fix this problem did was to request the loader be built as x86 rather than “Any CPU”. We having trouble seeing how this could have fixed anything.
Previously we had COM registration errors and “Requested registry access is not allowed” errors when trying to create TLB files with RegASM. Does anyone have any idea how his change could have affected this at all?
Your co-workers fix was correct. Here is why:
In Windows x64 a process may be started as 32bit or 64bit process. A 64bit process can only load 64bit dlls and a 32bit process only 32bit dlls.
If your platform target (e.g. specified in the project properties) of your .NET application is set to “Any CPU”, the intermediate code will be compiled to 32bit or 64bit code depending on the target platform, i.e. on a x64 system 64bit code will be generated. As a consequence, any 32-bit library such as native 32-bit COM components cannot be loaded into the64-bit process.