Hi,
What is the right way to deploy servicedcomponent on remote server?
Here is what i did and it failed to work - I tested the DCOM with VB
component to make sure the communication between two servers worked.
1. created a library project, created a class TestCom inherited from
ServicedComponent, make one test method to return computername from
Environment.MachineName; added strongely named key
2. compile this project to generate a dll, created a COM+ application as
server app, added this dll to that application
3. export this application as proxy to a msi and cab
4. copy this msi and cab to another server, run the msi file, verified that
application installed, remote server name is correct
5. open vs.net - trying to reference that dll - It did not allow me to
reference it as I could in VB - it asked me to reference the originally
assembly (this got me confused - if I wanted to use remote server approach,
that means I do not want to install my original assembly on client machine)
6. copied the orginal assembly from original machine, references it and try
to run, got error
System.UnauthorizedAccessException was unhandled
Message="Access is denied. (Exception from HRESULT: 0x80070005
(E_ACCESSDENIED))"
Source="mscorlib"
StackTrace:
at
System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32
errorCode, IntPtr errorInfo)
at System.EnterpriseServices.Thunk.Proxy.CoCreateObject(Type
serverType, Boolean bQuerySCInfo, Boolean& bIsAnotherProcess, String& uri)
at
System.EnterpriseServices.ServicedComponentProxyAttribute.CreateInstance(Type
serverType)
at
System.Runtime.Remoting.Activation.ActivationServices.IsCurrentContextOK(Type
serverType, Object[] props, Boolean bNewObj)
at EntSvrLibTester.Form1.button1_Click(Object sender, EventArgs e) in
C:\Neudesic\EntSvrLibTester\EntSvrLibTester\Form1.cs:line 20
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons
button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at
System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message&
m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd,
Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG&
msg)
at
System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32
dwComponentID, Int32 reason, Int32 pvLoopData)
at
System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32
reason, ApplicationContext context)
at
System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason,
ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)
at EntSvrLibTester.Program.Main() in
C:\Neudesic\EntSvrLibTester\EntSvrLibTester\Program.cs:line 17
at System.AppDomain.nExecuteAssembly(Assembly assembly, String[]
args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence
assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext
executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
Thanks very much!
John
"Peter Huang" [MSFT] - 23 May 2006 05:00 GMT
Hi John,
Currently I am researching the issue and we will reply here with more
information as soon as possible.
If you have any more concerns on it, please feel free to post here.
Thanks for your understanding!
Best regards,
Peter Huang
Microsoft Online Partner Support

Signature
Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
"Peter Huang" [MSFT] - 26 May 2006 08:14 GMT
Hi John,
Sorry for deplay reponse.
Based on my research, it seems to be the COM+ security error.
So please follow the steps below to isolate the problem
1. I assume you have completely installed the COM+ on the server machine
2. Create a VB6 application on the Server machine to test the COM+ app to
see if that works.
3. If yes, export the COM+ app as an MSI and install on the Client machine
4. repeat step 2 on the client machine to see if that works
5. Create a .NET application and add reference to the assembly(we need to
copy the .NET assembly to client machine, or the .NET did not have the
type definition about the COM+ application)
BTW: if your server machine is Windows 2003, which have a new feature in
COM+ service, the Role. Please add a new role and add your account into it.
Here is the config at my test environment for your reference.
1. I have a Domain account, domain\userA
2. Add a new role and add the account above into the role
3. Set the COM+ application's Identity to be user account above
4. and then export it as MSI and install it on the client machine.
5. copy the assembly onto client machine and the VB.NET application add
reference to it.
Best regards,
Peter Huang
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.