none
Type.GetTypeFromProgID not returning System.MarshalByRefObject RRS feed

  • Question

  • Hi Folks

    I built a prototype which does the following:

    1. Is a console application (for demo purposes only)

    2. Was intended to show how an SSRS .Net v3.5 assembly could call a v4.5.1 SSO application to return: a.) Database Connection string b.) Report Image Library url

    This works great as a standalone console application.

    I've take the same "basics" of this console application and wrapped it into a dll (an SSRS Data Processing Extension).

    The PROBLEM is, is that the console application instantiates as a System.MarshalByRefObject and external calls to the DLL only get instantiated as System.Object.

    Here's the code:

                    Type myClassAdapterType = Type.GetTypeFromProgID("Net35ToNet4xAdapter.MyClassAdapter");
                    Object myClassAdapterInstance = Activator.CreateInstance(myClassAdapterType);
                    Net35ToNet4xAdapter.IMyClassAdapter myClassAdapter = (Net35ToNet4xAdapter.IMyClassAdapter)myClassAdapterInstance;
                    string ret = myClassAdapter.DoNet4xAction(blahblahblah);

    Type.GetTypeFromProgID("Net35ToNet4xAdapter.MyClassAdapter"); works differently in the console application because everything is "in the application" (and needs not be registered)

    The external call to the DLL (which is registered) only shows myClassAdapterType as being from System.Object. Here's a comparison:

    CONSOLE APPLICATION WORKS

    Registered DLL CALLED EXTERNALLY FAILS

     

    ?Type.GetTypeFromProgID("Net35ToNet4xAdapter.MyClassAdapter")

    {Name = "__ComObject" FullName = "System.__ComObject"}

        [System.RuntimeType]: {Name = "__ComObject" FullName = "System.__ComObject"}

        base: {Name = "__ComObject" FullName = "System.__ComObject"}

        Assembly: {mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089}

        AssemblyQualifiedName: "System.__ComObject, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"

        Attributes: Public

        BaseType: {Name = "MarshalByRefObject" FullName = "System.MarshalByRefObject"}

        ContainsGenericParameters: false

        DeclaringMethod: 'Type.GetTypeFromProgID("Net35ToNet4xAdapter.MyClassAdapter").DeclaringMethod' threw an exception of type 'System.InvalidOperationException'

        DeclaringType: null

        FullName: "System.__ComObject"

        GenericParameterAttributes: 'Type.GetTypeFromProgID("Net35ToNet4xAdapter.MyClassAdapter").GenericParameterAttributes' threw an exception of type 'System.InvalidOperationException'

        GenericParameter 'Type.GetTypeFromProgID("Net35ToNet4xAdapter.MyClassAdapter").GenericParameterPosition' threw an exception of type 'System.InvalidOperationException'

        GUID: {4b5ad204-13fc-4c9f-9dc4-f0a6ec775d4f}

        HasElementType: false

        HasProxyAttribute: false

        IsAbstract: false

        IsAnsiClass: true

        IsArray: false

        IsAutoClass: false

        IsAutoLayout: true

        IsByRef: false

        IsClass: true

        IsCOMObject: true

        IsContextful: false

        IsEnum: false

        IsExplicitLayout: false

        IsGenericParameter: false

        IsGenericType: false

        IsGenericTypeDefinition: false

        IsImport: false

        IsInterface: false

        IsLayoutSequential: false

        IsMarshalByRef: true

        IsNested: false

        IsNestedAssembly: false

        IsNestedFamANDAssem: false

        IsNestedFamily: false

        IsNestedFamORAssem: false

        IsNestedPrivate: false

        IsNestedPublic: false

        IsNotPublic: false

        IsPointer: false

        IsPrimitive: false

        IsPublic: true

        IsSealed: false

        IsSerializable: false

        IsSpecialName: false

        IsSzArray: false

        IsUnicodeClass: false

        IsValueType: false

        IsVisible: false

        MemberType: TypeInfo

        Module: {CommonLanguageRuntimeLibrary}

        Namespace: "System"

        ReflectedType: null

        StructLayoutAttribute: {System.Runtime.InteropServices.StructLayoutAttribute}

        TypeHandle: {System.RuntimeTypeHandle}

        TypeInitializer: null

        UnderlyingSystemType: {Name = "__ComObject" FullName = "System.__ComObject"}

    ?Type.GetTypeFromProgID("Net35ToNet4xAdapter.MyClassAdapter")

    {Name = "MyClassAdapter" FullName = "Net35ToNet4xAdapter.MyClassAdapter"}

        [System.RuntimeType]: {Name = "MyClassAdapter" FullName = "Net35ToNet4xAdapter.MyClassAdapter"}

        base: {Name = "MyClassAdapter" FullName = "Net35ToNet4xAdapter.MyClassAdapter"}

        Assembly: {Net35ToNet4xAdapter, Version=1.0.0.0, Culture=neutral, PublicKeyToken=09abb560dc6eacfe}

        AssemblyQualifiedName: "Net35ToNet4xAdapter.MyClassAdapter, Net35ToNet4xAdapter, Version=1.0.0.0, Culture=neutral, PublicKeyToken=09abb560dc6eacfe"

        Attributes: Public | Serializable | BeforeFieldInit

        BaseType: {Name = "Object" FullName = "System.Object"}

        ContainsGenericParameters: false

        DeclaringMethod: 'Type.GetTypeFromProgID("Net35ToNet4xAdapter.MyClassAdapter").DeclaringMethod' threw an exception of type 'System.InvalidOperationException'

        DeclaringType: null

        FullName: "Net35ToNet4xAdapter.MyClassAdapter"

        GenericParameterAttributes: 'Type.GetTypeFromProgID("Net35ToNet4xAdapter.MyClassAdapter").GenericParameterAttributes' threw an exception of type 'System.InvalidOperationException'

        GenericParameterNet35ToNet4xAdapter.MyClassAdapter").GenericParameterPosition' threw an exception of type 'System.InvalidOperationException'

        GenericTypeArguments: {System.Type[0]}

        GUID: {a6574755-925a-4e41-a01b-b6a0eef72df0}

        HasElementType: false

        IsAbstract: false

        IsAnsiClass: true

        IsArray: false

        IsAutoClass: false

        IsAutoLayout: true

        IsByRef: false

        IsClass: true

        IsCOMObject: false

        IsConstructedGenericType: false

        IsContextful: false

        IsEnum: false

        IsExplicitLayout: false

        IsGenericParameter: false

        IsGenericType: false

        IsGenericTypeDefinition: false

        IsImport: false

        IsInterface: false

        IsLayoutSequential: false

        IsMarshalByRef: false

        IsNested: false

        IsNestedAssembly: false

        IsNestedFamANDAssem: false

        IsNestedFamily: false

        IsNestedFamORAssem: false

        IsNestedPrivate: false

        IsNestedPublic: false

        IsNotPublic: false

        IsPointer: false

        IsPrimitive: false

        IsPublic: true

        IsSealed: false

        IsSecurityCritical: true

        IsSecuritySafeCritical: false

        IsSecurityTransparent: false

        IsSerializable: true

        IsSpecialName: false

        IsUnicodeClass: false

        IsValueType: false

        IsVisible: true

        MemberType: TypeInfo

        Module: {Net35ToNet4xAdapter.dll}

        Namespace: "Net35ToNet4xAdapter"

        ReflectedType: null

        StructLayoutAttribute: {System.Runtime.InteropServices.StructLayoutAttribute}

        TypeHandle: {System.RuntimeTypeHandle}

        TypeInitializer: null

        UnderlyingSystemType: {Name = "MyClassAdapter" FullName = "Net35ToNet4xAdapter.MyClassAdapter"}

     

     

     

     

     

    If anyone can help I'd appreciate it. I have a MS support call placed but I'm going no where with this.

    Thanks

    Rob



    Rob K

    Monday, October 27, 2014 7:30 PM

All replies

  • Hello ebiz-tutor,

    From your description, it seems that you create/register a .NET COM server, and then user a .NET client to access the .NET COM server, I am confused why not add reference to the .NET assembly directly.

    After searching for a while through the MSDN documents, the overridden method “public static Type GetTypeFromProgID(string progID, string server);” which could return the based type as System.MarshalByRefObject:

    This is the test code:

    try
    
                {
    
                    // Use the ProgID localhost\HKEY_CLASSES_ROOT\DirControl.DirList.1. 
    
                    string theProgramID = "C20140901.OrderHeader";
    
                    // Use the server name localhost. 
    
                    string theServer = "localhost";
    
                    // Make a call to the method to get the type information for the given ProgID.
    
                    Type myType = Type.GetTypeFromProgID(theProgramID,theServer);
    
                    if (myType == null)
    
                    {
    
                        throw new Exception("Invalid ProgID or Server.");
    
                    }
    
                    Console.WriteLine("GUID for ProgID DirControl.DirList.1 is {0}.", myType.GUID);
    
                }
    
                catch (Exception e)
    
                {
    
                    Console.WriteLine("An exception occurred.");
    
                    Console.WriteLine("Source: {0}", e.Source);
    
                    Console.WriteLine("Message: {0}", e.Message);
    
                }
    


    And according to this discussion, it seems that when running with useLegacyV2RuntimeActivationPolicy="true", it would return the MarshalByRefObject type. Please have a try.

    Regards,

    Fred.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Tuesday, October 28, 2014 3:49 AM
    Moderator
  • Hi Fred

    This did instantiate CORRECTLY, but now the Activator throws an ERR (which I'm trying to figure out)

                    //Type myClassAdapterType = Type.GetTypeFromCLSID(new Guid("f5ce6f0f-8249-4dbb-993c-88c21140e25d"));
                    //Type myClassAdapterType = Type.GetTypeFromProgID("Net35ToNet4xAdapter.MyClassAdapter");
                    Type myClassAdapterType = Type.GetTypeFromProgID("Net35ToNet4xAdapter.MyClassAdapter", "localhost");

                    Object myClassAdapterInstance = Activator.CreateInstance(myClassAdapterType);

    Retrieving the COM class factory for remote component with CLSID {A6574755-925A-4E41-A01B-B6A0EEF72DF0} from machine localhost failed due to the following error: 80040154 localhost.

    :

    :

    Just so you have some idea as to how all of the pieces fit:

    1. VS2013 with BI to

    2. Report project to

    3. calls from a CustomQueryDesigner (Microsoft.ReportingServices.Interfaces & QueryDesigners)

    4. the CustomQueryDesigner interfaces to a CustomDataProcessingExtension

    5. which talks to the 3 DLLs in SQL Server (.Net 3.5, 3.5-to-4.5.1, 4.5.1)

    6. the v4.5.1 DLL (bound to SQL Server SSRS via Microsoft.ReportingServices.Interfaces) makes the SSO call (which works just fine as a CONSOLE app, so I know I'm good in this respect) which returns the DB connection and report image path)

    I tried my darned-est to keep all of this out of the registry (know that simple DLL location in the solution and using app.manifest for the console app let me get around all of this).

    Is there any recommendation here (while I research this)?

    Thanks so much for your time

    Rob


    Rob K




    • Edited by ebiz-tutor Tuesday, October 28, 2014 5:51 PM update
    Tuesday, October 28, 2014 11:32 AM
  • It looks like this has something to do with security for the component (based on what I'm reading on error 80040154).

    So I went to Administrative Tools->Component services.

    Under the tree, I went to Component Services->Computers->My Computer->

    But I'm unable to find my component. Oddly, the interface doesn't seem to allow me to search for the CLSID (no search button), nor the name, nor sort by CLSID. Unfortunately, this is a UX functional design mess and after search up and down for 3 tries, I'm going to walk away and take a break before I start throwing things...

    Is there any chance that there are 2 different versions of these hives based on 32/64 registry of the component?

    When I registered these DLLs, I used:

    >"%WINDIR%\Microsoft.NET\Framework\v4.0.30319\regasm.exe" NetxxxAssembly.dll /codebase

    Thanks

    Rob


    Rob K

    Tuesday, October 28, 2014 12:52 PM
  • just so you are aware of the 2 types and how they instantiate (console app versus calling an external dll)

     

    CONSOLE APPLICATION WORKS

    Registered DLL CALLED EXTERNALLY FAILS

    ?Type.GetTypeFromProgID("Net35ToNet4xAdapter.MyClassAdapter")

    {Name = "__ComObject" FullName = "System.__ComObject"}

        [System.RuntimeType]: {Name = "__ComObject" FullName = "System.__ComObject"}

        base: {Name = "__ComObject" FullName = "System.__ComObject"}

        Assembly: {mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089}

        AssemblyQualifiedName: "System.__ComObject, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"

        Attributes: Public

        BaseType: {Name = "MarshalByRefObject" FullName = "System.MarshalByRefObject"}

        ContainsGenericParameters: false

        DeclaringMethod: 'Type.GetTypeFromProgID("Net35ToNet4xAdapter.MyClassAdapter").DeclaringMethod' threw an exception of type 'System.InvalidOperationException'

        DeclaringType: null

        FullName: "System.__ComObject"

        GenericParameterAttributes: 'Type.GetTypeFromProgID("Net35ToNet4xAdapter.MyClassAdapter").GenericParameterAttributes' threw an exception of type 'System.InvalidOperationException'

        GenericParameter 'Type.GetTypeFromProgID("Net35ToNet4xAdapter.MyClassAdapter").GenericParameterPosition' threw an exception of type 'System.InvalidOperationException'

        GUID: {4b5ad204-13fc-4c9f-9dc4-f0a6ec775d4f}

        HasElementType: false

        HasProxyAttribute: false

        IsAbstract: false

        IsAnsiClass: true

        IsArray: false

        IsAutoClass: false

        IsAutoLayout: true

        IsByRef: false

        IsClass: true

        IsCOMObject: true

        IsContextful: false

        IsEnum: false

        IsExplicitLayout: false

        IsGenericParameter: false

        IsGenericType: false

        IsGenericTypeDefinition: false

        IsImport: false

        IsInterface: false

        IsLayoutSequential: false

        IsMarshalByRef: true

        IsNested: false

        IsNestedAssembly: false

        IsNestedFamANDAssem: false

        IsNestedFamily: false

        IsNestedFamORAssem: false

        IsNestedPrivate: false

        IsNestedPublic: false

        IsNotPublic: false

        IsPointer: false

        IsPrimitive: false

        IsPublic: true

        IsSealed: false

        IsSerializable: false

        IsSpecialName: false

        IsSzArray: false

        IsUnicodeClass: false

        IsValueType: false

        IsVisible: false

        MemberType: TypeInfo

        Module: {CommonLanguageRuntimeLibrary}

        Namespace: "System"

        ReflectedType: null

        StructLayoutAttribute: {System.Runtime.InteropServices.StructLayoutAttribute}

        TypeHandle: {System.RuntimeTypeHandle}

        TypeInitializer: null

        UnderlyingSystemType: {Name = "__ComObject" FullName = "System.__ComObject"}

    ?Type.GetTypeFromProgID("Net35ToNet4xAdapter.MyClassAdapter", "localhost")

    {Name = "__ComObject" FullName = "System.__ComObject"}

        [System.RuntimeType]: {Name = "__ComObject" FullName = "System.__ComObject"}

        base: {Name = "__ComObject" FullName = "System.__ComObject"}

        Assembly: {mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089}

        AssemblyQualifiedName: "System.__ComObject, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"

        Attributes: Public

        BaseType: {Name = "MarshalByRefObject" FullName = "System.MarshalByRefObject"}

        ContainsGenericParameters: false

        DeclaringMethod: 'Type.GetTypeFromProgID("Net35ToNet4xAdapter.MyClassAdapter", "localhost").DeclaringMethod' threw an exception of type 'System.InvalidOperationException'

        DeclaringType: null

        FullName: "System.__ComObject"

        GenericParameterAttributes: 'Type.GetTypeFromProgID("Net35ToNet4xAdapter.MyClassAdapter", "localhost").GenericParameterAttributes' threw an exception of type 'System.InvalidOperationException'

        GenericParameter 'Type.GetTypeFromProgID("Net35ToNet4xAdapter.MyClassAdapter", "localhost").GenericParameterPosition' threw an exception of type 'System.InvalidOperationException'

        GenericTypeArguments: {System.Type[0]}

        GUID: {a6574755-925a-4e41-a01b-b6a0eef72df0}

        HasElementType: false

        IsAbstract: false

        IsAnsiClass: true

        IsArray: false

        IsAutoClass: false

        IsAutoLayout: true

        IsByRef: false

        IsClass: true

        IsCOMObject: true

        IsConstructedGenericType: false

        IsContextful: false

        IsEnum: false

        IsExplicitLayout: false

        IsGenericParameter: false

        IsGenericType: false

        IsGenericTypeDefinition: false

        IsImport: false

        IsInterface: false

        IsLayoutSequential: false

        IsMarshalByRef: true

        IsNested: false

        IsNestedAssembly: false

        IsNestedFamANDAssem: false

        IsNestedFamily: false

        IsNestedFamORAssem: false

        IsNestedPrivate: false

        IsNestedPublic: false

        IsNotPublic: false

        IsPointer: false

        IsPrimitive: false

        IsPublic: true

        IsSealed: false

        IsSecurityCritical: false

        IsSecuritySafeCritical: false

        IsSecurityTransparent: true

        IsSerializable: false

        IsSpecialName: false

        IsUnicodeClass: false

        IsValueType: false

        IsVisible: false

        MemberType: TypeInfo

        Module: {CommonLanguageRuntimeLibrary}

        Namespace: "System"

        ReflectedType: null

        StructLayoutAttribute: {System.Runtime.InteropServices.StructLayoutAttribute}

        TypeHandle: {System.RuntimeTypeHandle}

        TypeInitializer: null

        UnderlyingSystemType: {Name = "__ComObject" FullName = "System.__ComObject"}

     

     

     


    Rob K

    Tuesday, October 28, 2014 3:44 PM
  • Hello,

    This blog describes this error and the possible workaround is to set AnyCpu to X86 since the VSS Interop is a managed assembly using 32-bit Framework:

    http://blogs.msdn.com/b/karthick/archive/2006/02/28/540780.aspx

    You could try it.

    Regards.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Wednesday, October 29, 2014 9:25 AM
    Moderator
  • Hi Fred

    I've already tried/did this (and maybe a dozen other things that came up for this error code) and it didn't work for me.

    When I built the prototype (which works fine), I stuck with this philosophy:

    http://blog.functionalfun.net/2012/09/a-quick-guide-to-registration-free-com.html

    My hopes were to make it uncomplicated (so that an operations level person would be able to do setup) and to stay away from this kind of proprietary kind of setup technology in the first place (which seems to be on the list of technologies going into extinction at Microsoft, in terms of getting paid support who understand it). Plus, I really don't need to do anything serious enough where there's Remoting involved, etc.. I'm only trying to "fake out" .Net in terms of going from a fixed SSRS .Net v3.5 environment to our internal SSO .Net v4.5.1 environment (which is the simplest AppDomain kind of switch).

    I'm going to "circle the wagons" today on making another attempt at keeping it COM-free. This will make things more difficult (because I really needed this to work in x86 for VS2013 and x64 in SSRS). If this doesn't work out, I'm going to have to go back to my management and tell them either to drop the project (which is now about a month over due) or pay for a second Microsoft Support call.

    But thanks so much for your time.

    Rob


    Rob K

    Wednesday, October 29, 2014 11:28 AM
  • Hello Rob,

    For this thread, I would also help try to invoke someone experienced to look into this thread, this may take some time and as soon as we get any result, we will tell you.

    Regards.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Thursday, October 30, 2014 1:16 AM
    Moderator
  • Hi Rob,

    First, Component Service is used to check the COM+ application registered by Regsvcs.exe (.NET Services Installation Tool)

    To view the COM component registered by regasm, please Using the OLE/COM Object Viewer

    Second, we do have 32/64 bit regasm. For 32bit, please find it under

    "%WINDIR%\Microsoft.NET\Framework\v4.0.30319\"

    For 64bit, please find it under

    "%WINDIR%\Microsoft.NET\Framework64\v4.0.30319\"

    See if you can make some difference based on above info.


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    Alan Yao
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Thursday, October 30, 2014 2:04 AM
  • Hi Alan,

    First, Component Service is used to check the COM+ application registered by Regsvcs.exe (.NET Services Installation Tool)

    From “dir c:\Windows\Microsoft.Net\regsvcs.exe /s” (I’m on a Windows Server 2012, using VS 2013 Ultimate, running Hyper-V in order to completely test the solution.). Note that I don’t see anything x86. What I would use is in green, correct?

    Directory of c:\Windows\Microsoft.Net\Framework\v2.0.50727

    05/26/2014  06:12 PM            32,768 RegSvcs.exe

    Directory of c:\Windows\Microsoft.Net\Framework\v4.0.30319

    07/11/2012  10:02 PM            44,968 RegSvcs.exe

    Directory of c:\Windows\Microsoft.Net\Framework64\v2.0.50727

    05/26/2014  06:12 PM            28,672 RegSvcs.exe

    Directory of c:\Windows\Microsoft.Net\Framework64\v4.0.30319

    07/11/2012  10:01 PM            44,456 RegSvcs.exe

    I’ve BEEN using this approach for COM registration (but will try your approach now):

     

     

    CustomDataProcessingExtension.dll has no COM registration requirement, it is simply a helper to the SSRS Microsoft.ReportingServices.Interfaces.dll functionality

    Nothing required, it is only deployed

    .Net v2.0.50727 (3.5)

     

     

    C:\SSRSDPE\CustomDataExtension\ Net35ToNet4xAdapter>"%WINDIR%\Microsoft.NET\Framework\v4.0.30319\regasm.exe" Net35ToNet4xAdapter.dll /codebase

     

    Register

    C:\SSRSDPE\CustomDataExtension\ Net35ToNet4xAdapter>"%WINDIR%\Microsoft.NET\Framework\v4.0.30319\regasm.exe" /u Net35ToNet4xAdapter.dll /codebase

     

    UnRegister

    C:\SSRSDPE\CustomDataExtension\ Net35ToNet4xAdapter>"%WINDIR%\Microsoft.NET\Framework\v4.0.30319\regasm.exe" Net35ToNet4xAdapter.dll /codebase

     

    RE-Register (simply ignore the prompted warning)

     

     

    C:\SSRSDPE\CustomDataExtension\Net4xAssembly>"%WINDIR%\Microsoft.NET\Framework\v4.0.30319\regasm.exe" Net4xAssembly.dll /codebase

     

    Register

    C:\SSRSDPE\CustomDataExtension\Net4xAssembly>"%WINDIR%\Microsoft.NET\Framework\v4.0.30319\regasm.exe" /u Net4xAssembly.dll /codebase

     

    UnRegister

    C:\SSRSDPE\CustomDataExtension\Net4xAssembly>"%WINDIR%\Microsoft.NET\Framework\v4.0.30319\regasm.exe" Net4xAssembly.dll /codebase

     

    RE-Register (simply ignore the prompted warning)

     

     

    To view the COM component registered by regasm, please Using the OLE/COM Object Viewer

    Second, we do have 32/64 bit regasm. For 32bit, please find it under

    "%WINDIR%\Microsoft.NET\Framework\v4.0.30319\"

    For 64bit, please find it under

    "%WINDIR%\Microsoft.NET\Framework64\v4.0.30319\"

    --------------------------------------------------------------------------------------------------------------------

    From “dir c:\oleview.exe /s” (I’m on a Windows Server 2012, using VS 2013 Ultimate, running Hyper-V in order to completely test the solution.)

    I get:

    Volume Serial Number is FEEF-D061

     Directory of c:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin

    03/19/2010  03:02 PM           188,752 OleView.Exe

    Directory of c:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\x64

    03/19/2010  03:02 PM           234,832 OleView.Exe

     Directory of c:\Program Files (x86)\Windows Kits\8.0\bin\x64

    08/03/2013  12:35 AM           234,584 oleview.exe

    Directory of c:\Program Files (x86)\Windows Kits\8.0\bin\x86

    08/02/2013  11:55 PM           200,792 oleview.exe

    Directory of c:\Program Files (x86)\Windows Kits\8.1\bin\x64

    07/12/2014  01:30 AM           232,592 oleview.exe

    Directory of c:\Program Files (x86)\Windows Kits\8.1\bin\x86

    06/07/2014  03:12 AM           199,856 oleview.exe

    The diagram below is a high-level overview. Shaded is built. Original MS support call was placed because MS screwed up Microsoft.ReportingServices.QueryDesigners.dll in SQL Server 2012 (it referenced a v4 assembly and SSRS Microsoft.ReportingServices.Interfaces.dll only supports up to v3.5 .Net). We had to break out the code for the Custom Query Designer and Custom Data Processing Extension because of this problem. (SQL Server 2014 changes this, but this is NOT an option for us at this point in time.)

    To give you a 101 understanding of the problem: Our customer domain is 26k+. We want to DYNAMICALLY set connection string and report image url, based on OrgID lookup out of SSO. This required a combined Custom Query Designer, Custom Data Processing Extension and Reports Definition Customization Extension (yes, all at once to achieve our objectives).

    Proof of concept for SSO (which was a console app) work just fine. It plays an interface “shell game” with .Net (v3.5-to-v4.5.1) to get access to SSO (as an up-and-down thunking process). It is shown in the diagram which red astericks.  REMEMBER, it had to be built in 3 pieces to achieve our needs. IT IS THE Net35ToNet4xAdapter.dll and Net4xAssembly.dll which need to be registered and accessed. CustomDataProcessingExtension.dll serves as the helper to Microsoft.ReportingServices.Interfaces and the caller (on the connection wrapper) to SSO. Also, remember this all has to be functional out of the Visual Studio report project (having one part working and the other not working is not an option).

    I appreciate all of your help and will try these recommendations today (and get back with you). Please let me know if you need anything more from me and I could send you non-proprietary code if you had question. I’ve built other types of SSRS extensions in the past, but I’m more web developer than anything else (although I was part of the SQL Server Yukon alpha tester team).



    Rob K


    • Edited by ebiz-tutor Thursday, October 30, 2014 2:26 PM misspelling
    Thursday, October 30, 2014 1:20 PM
  • diagram mentioned above (which wouldn't fit into the last post)


    Rob K


    • Edited by ebiz-tutor Thursday, October 30, 2014 1:37 PM
    Thursday, October 30, 2014 1:23 PM
  • As I'm walking through your recommendations, and comparing those to our practices, I've noticed that I was using the "Component Services (COM+) management tool v6.2"  versus the OLE/COM Object Viewer v6.3.9600.17200 (your recommendation). Why would I use one versus the other since they have overlap (it appears)?

    In either case, both of these need some UI work in the area of being able to find items.

    Again, this is just a learning question for me.

    Thanks

    Rob


    Rob K


    • Edited by ebiz-tutor Thursday, October 30, 2014 2:40 PM add clarification
    Thursday, October 30, 2014 2:39 PM
  • ok, so here's the low down:

     

    1. Net35ToNet4xAdapter registers with warnings and here's a screenshot (will be on next post).

     

    2. Net4xAssembly does not register and I'm baffled as to what the issue is, here's screenshot (will be on following post)

     

    3. I do see a bunch of things in the Object Viewer (but not quite sure how they got there? whether it be VS or the last process I was using), here's a screenshot (will be on following post)

     

    4. Here’s the problems I’m dealing with now:

    Type myClassAdapterType = Type.GetTypeFromProgID("Net35ToNet4xAdapter.MyClassAdapter"); // instantiates as system.object

    Type myClassAdapterType = Type.GetTypeFromProgID("Net35ToNet4xAdapter.MyClassAdapter", "localhost"); // instantiates as system.marshalbyrefobject

     

    Object myClassAdapterInstance = Activator.CreateInstance(myClassAdapterType);  // works fine

     

    Net35ToNet4xAdapter.IMyClassAdapter myClassAdapter = (Net35ToNet4xAdapter.IMyClassAdapter)myClassAdapterInstance; // crashes

    // even though I’m trying to cast as “Net35ToNet4xAdapter.IMyClassAdapter”, runtime sees this type as being both in Net35ToNet4xAdapter *and* DMx.CustomDataProcessingExtension.dl  (it has to be in DMx.CustomDataProcessingExtension.dll, because this is the interface all the way through to Net4xAssembly.


    Rob K

    Thursday, October 30, 2014 7:17 PM

  • Rob K

    Thursday, October 30, 2014 7:18 PM

  • Rob K

    Thursday, October 30, 2014 7:18 PM

  • Rob K

    Thursday, October 30, 2014 7:19 PM
  • Hi Rob,

    From your screenshot, I found you changed regasm to regsvcs. I cannot find any reason why you want a COM+ application. I think a simple registered COM is enough. And apply Fred's suggestion to avoid the wrong type issue.

    And I really feel this is very urgent issue for you. If so, I will suggest you open a paid support ticket with high serverity requirment.


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    Alan Yao
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.


    Friday, October 31, 2014 1:40 AM
  • Hi Alan

    Respectfully, and not to be a "knob", I think I'm going to stick this one out on my own. I do think I have a handle on this, and I've actually done more training on the existing support ticket, than I've actually learned (to the tune of having 2 MSer's telling me it would be a great idea and/or nice to write an article/book on this). (Would love to write on this, if we were doing something "serious" like HDInsight reductions and/or Hekaton with BI.) But my priority, is to get this software off of the ground, stable and delivered.

    While it was nice to have the hardware resources I didn't have to do dump analysis on SSRS crashes (which didn't produce logs), I'll get over it. I need better expertise and this one probably goes as deep as the product team (if there is one still for 2012).

    I've got better perspective on what COM version does what, but would have really liked to stay away from it in the first place.

    To avoid the type casting issues with the .NET v3.5-to-v4.5.1 routine, I'm going to break SSO out into it's own DLL. It'll be easier to test and I won't have to wrestle with SSRS and what it expects for a Custom Data Processing Extension.

    Thanks for all of your help Alan and Fred

    Rob


    Rob K

    Friday, October 31, 2014 12:44 PM