现有如下代码:
RemotingConfiguration.Configure(...)
RemoteObject refObj = new RemoteObject(); //cf为Remoting承载远程组件
BusiObject o = refObj.GetObject("Name") as BusiObject; //返回对象为EnterpriceService
o.TestMethod(); //此处会出错
就此问题,微软已有解答:Exposing ServicedComponents As a Remoting Endpoint from a COM+ Dllhost.exe Process Is Not Supported http://support.microsoft.com/default.aspx?scid=kb;en-us;322627
| ? |
You can host your ServicedComponents in IIS by selecting uses SOAP on the Activation tab of the properties for the COM+ application. |
| ? |
You can use a custom host that hosts the ServicedComponents from a COM+ library application. |
其实将组件承载在Library模式的COM+应用里即可