C# Windows Service COM exception 80080005 when starting application -
i have created windows service try start application (in case catia).
i use following code:
private application getapplicationobject(string progid) { application appobject = null; //try allready open instance of application try { appobject = (application)marshal.getactiveobject(progid); } catch { //create new instance of application instead appobject = (application)activator.createinstance(type.gettypefromprogid(progid)); } return appobject; }
i following error when service try start application:
system.runtime.interopservices.comexception (0x80080005): retrieving com class factory component clsid {87fd6f40-e252-11d5-8040-0010b5fa1031} failed due following error: 80080005. @ system.runtimetypehandle.createinstance(runtimetype type, boolean publiconly, boolean nocheck, boolean& canbecached, runtimemethodhandle& ctor, boolean& bneedsecuritycheck) @ system.runtimetype.createinstanceslow(boolean publiconly, boolean fillcache) @ system.runtimetype.createinstanceimpl(boolean publiconly, boolean skipvisibilitychecks, boolean fillcache) @ system.activator.createinstance(type type, boolean nonpublic) @ catia.catia.getapplicationobject(string progid)
important: when run code windows application instead of windows service works fine. tried start catia first , have running in background, service not able catch it.
i run service local system, , have checked box "interact desktop".
my progid catia.application, , said works when run application instead of service.
any idea of causing this?
i have found solution.
i found in forum, had problem run application through web. strangely enough, solution worked me too.
- click run
- enter dcomcnfg
- browse way component services>computers>my computer>dcomconfig>
- then find application, in case "catia application".
- right click>properties
- go "identity" tab
- change user should run application "the launching user" "the interactive user".
now works me. still not able catch process (getactiveobject) if start manually first. @ least service manage start new instance without errors.
i think can helpful lot of people come across error message when trying start application windows service.
Comments
Post a Comment