Hi Folks
I've been kind of forced between a "rock and a hard place" in terms of what we refer to as our "Global Directory" (SSO - single sign-on services) and how SQL Server 2012 SSRS works as well.
1. What I need to do with SSRS 2012 is a "hardwired" at .Net v3.5 (its a Microsoft.ReportServices.Interfaces.dll kind of thing).
2. What we've hardwired into our own development for SSO is .Net v4.5.1 (and no, unfortunately our software environment is NOT VERSIONED/wasn't history'd and checkpointed for use at various versions (for adaptability in area like this),
etc..
3. I've managed to construct a CONSOLE application which does the up-n-down "thunking" between the .Net versions with a main program and 2 dlls. So we basically go back and forth WITHOUT ISSUE (SSRS v3.5-up/down thunk-v4.5.1 SSO). If you REALLY
want the previous gory details, you can look here: https://social.msdn.microsoft.com/Forums/vstudio/en-US/d27d3c40-66cd-45a8-b036-b3d1211ace2f/typegettypefromprogid-not-returning-systemmarshalbyrefobject?forum=netfxbcl&prof=required (there's diagrams,
discussions, etc.)
The way this up-and-down thunking was done, was via Interfaces (and was the only way I know of to do anything like this). The "trickery" was binding Interfaces from different DLLs with the same name.
This works great in a simple CONSOLE application, but in the context of SSRS and COM registered assemblies it can come around and bite you quickly ;)
Back to my problem... When I execute this code:
try
{
Type myClassAdapterType = Type.GetTypeFromProgID("Net35ToNet4xAdapter.MyClassAdapter");
Object myClassAdapterInstance = Activator.CreateInstance(myClassAdapterType);
Net35ToNet4xAdapter.IMyClassAdapter myClassAdapter = (Net35ToNet4xAdapter.IMyClassAdapter)myClassAdapterInstance;
on the last line, I get the error:
The type 'Net35ToNet4xAdapter.IMyClassAdapter' exists in both 'DMx.CustomDataProcessingExtension.dll' and 'Net35ToNet4xAdapter.dll'...
Which is correct, IMyClassAdapter DOES exist in both. This is the only way to go back and forth in .NET.
Is there a simple way to cast/cast as the myClassAdapterInstance as a particular dll with that mentioned interface?
Thanks
Rob
Rob K