Hi, i asked this question in the component services group but appears to
be dead, so i hope is ok to ask the question here,
Is possible to use the same DLL for a .net application and for COM+?.
I need the same code to be available for .Net (windows forms app) and
regular asp clients (asp 3.0),
my class inherits from ServicedComponent so I can register it for COM+
in the server so the asp clients can call it, and added a reference to
the DLL in a .net application and call it directly, the problem is
that running the .Net client in another computer does not work the
exception is
System.UnauthorizedAccessException: Access denied.
at System.Runtime.InteropServices.Marshal.ThrowExcept ionForHR(Int32
errorCode, IntPtr errorInfo)
at System.EnterpriseServices.Thunk.Proxy.CoCreateObje ct(Type
serverType, Boolean bQuerySCInfo, Boolean& bIsAnotherProcess, String&
uri)
at
System.EnterpriseServices.ServicedComponentProxyAt tribute.CreateInstance(Type
serverType)
at
System.Runtime.Remoting.Activation.ActivationServi ces.IsCurrentContextOK(Type
serverType, Object[] props, Boolean bNewObj)
the code in the application is :
Dim obj As Cnbv.Sait.Encripta.AlgorithmSymmetric
Dim res As String
obj = New Cnbv.Sait.Encripta.AlgorithmSymmetric
res = obj.Cipher(Me.TextBox1.Text, "asdasd")
MessageBox.Show(res)
obj.Dispose()
Obviously the application is trying to call the COM+ instead of the
local DLL, i don't know if what i want is possible, or how to
accomplish it.
I also tried removing the servicedcomponent from my class and install it
in COM+ through the .tlb file (the DLL has the option "register for com"
enabled) but it wont install it.
It Appears the the only solution is to create two DLL, one for the
server and another for the .Net clients.
Thanks in advance.
Juan Zamudio