C# ServicedComponent running out-of-process gets File Not Found exception on one machine

三世轮回 提交于 2019-12-13 19:33:31

问题


I've written a stupid-simple ServicedComponent (COM+ component) to run out-of-process and wrap an x86 only COM component on an x64 server. On my test VM (Server 2008 R2) it works fine. On the production box, I get a file not found exception.

C:\Windows\Microsoft.NET\Framework\v2.0.50727>C:\Testapp.exe The system cannot find the file specified. (Exception from HRESULT: 0x80070002) 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 Testapp.Program.Main(String[] args) in D:\TFS\Testapp\Program.cs:line 11

Line 11 of Program.cs is where I instantiate an object of the COM type that I am wrapping.

Again, This works fine on my x64 Win 7 development machine, and my x64 test VM. I'm building my component x86, and registering with the 32bit version of regsvcs from a 32bit command prompt.

What on earth am I doing wrong or forgetting?

来源:https://stackoverflow.com/questions/3162866/c-sharp-servicedcomponent-running-out-of-process-gets-file-not-found-exception-o

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!