访问远程 com+ 对象时如何修复“80070005 访问被拒绝”?

How to fix '80070005 Access is denied' when accessing remote com+ object?

当我尝试从远程 PC 调用 COM+ 对象的方法时出现错误:

System.InvalidCastException
  HResult=0x80004002
  Message=Unable to cast COM object of type 'System.__ComObject' to interface type 'System.EnterpriseServices.IRemoteDispatch'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{6619A740-8154-43BE-A186-0319578E02DB}' failed due to the following error: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)).
  Source=System.EnterpriseServices
  StackTrace:
   at System.EnterpriseServices.RemoteServicedComponentProxy.Invoke(IMessage reqMsg)
   at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
   at ComCalculator.Calculator.Sum(Int32 a, Int32 b)
   at ConsoleApp1.Program.Main(String[] args)

dll:

[assembly: ApplicationActivation(ActivationOption.Server)]
[assembly: ApplicationAccessControl(false)]

namespace ComCalculator
{
    [ClassInterface(ClassInterfaceType.AutoDual)]
    [ComponentAccessControl(false)]
    public class Calculator : ServicedComponent
    {
        [AutoComplete(true)]
        public int Sum(int a, int b)
        {
            return a + b;
        }
    }
}

客户:

ComCalculator.Calculator c = new ComCalculator.Calculator();
var res = c.Sum(34, 65);

ServerPC 和 ClientPC 不在一个域中,因此我需要在两台 PC 上使用相同的登录名和密码的用户。