[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.interop

Cannot create remote COM on my own machine

AlexZh

9/4/2007 11:01:00 PM

I read a lot of threads trying th solve the problem but with no
success.
I have my own very simple .Net com (C#). In the project properties I
set "Register for COM interop", so all the registration is done.
In my client code I had:
Type myComType = Type.GetTypeFromProgID(ProgId,"",true);
Object com = Activator.CreateInstance(myComType);

Activator.CreateInstance() always throws an exception "Class not
registered".
So, I've change the code to:

Type myComType = Type.GetTypeFromProgID(ProgId,"",true);
Type myComTypeEx = Type.GetTypeFromCLSID(myComType .GUID);
Object com = Activator.CreateInstance(myComTypeEx);

That works just fine.
However I must do it on a remote machine. So, I've change the code to:
Type myComType = Type.GetTypeFromProgID(ProgId,srvrName,true);
Type myComTypeEx = Type.GetTypeFromCLSID(myComType .GUID, srvrName);
Object com = Activator.CreateInstance(myComTypeEx);

That case Activator.CreateInstance always throws the same exception
"Class not registered".

You help is highly appreciated.
Alex

7 Answers

Patrick Steele

9/5/2007 12:37:00 AM

0

In article <1188946830.701422.141530@w3g2000hsg.googlegroups.com>,
lalexzh@yahoo.com says...
> I read a lot of threads trying th solve the problem but with no
> success.
> I have my own very simple .Net com (C#). In the project properties I
> set "Register for COM interop", so all the registration is done.
> In my client code I had:
> Type myComType = Type.GetTypeFromProgID(ProgId,"",true);
> Object com = Activator.CreateInstance(myComType);
>
> Activator.CreateInstance() always throws an exception "Class not
> registered".
> So, I've change the code to:
>
> Type myComType = Type.GetTypeFromProgID(ProgId,"",true);
> Type myComTypeEx = Type.GetTypeFromCLSID(myComType .GUID);
> Object com = Activator.CreateInstance(myComTypeEx);
>
> That works just fine.
> However I must do it on a remote machine. So, I've change the code to:
> Type myComType = Type.GetTypeFromProgID(ProgId,srvrName,true);
> Type myComTypeEx = Type.GetTypeFromCLSID(myComType .GUID, srvrName);
> Object com = Activator.CreateInstance(myComTypeEx);
>
> That case Activator.CreateInstance always throws the same exception
> "Class not registered".
>
> You help is highly appreciated.

Have you copied the .NET COM (C#) DLL over to the remote machine and
registered it with RegAsm?

--
Patrick Steele (patrick@mvps.org)
http://weblogs.asp.n...

AlexZh

9/5/2007 5:13:00 PM

0

On Sep 4, 7:36 pm, Patrick Steele <patr...@mvps.org> wrote:
> In article <1188946830.701422.141...@w3g2000hsg.googlegroups.com>,
> lale...@yahoo.com says...
>
>
>
>
>
> > I read a lot of threads trying th solve the problem but with no
> > success.
> > I have my own very simple .Net com (C#). In the project properties I
> > set "Register for COM interop", so all the registration is done.
> > In my client code I had:
> > Type myComType = Type.GetTypeFromProgID(ProgId,"",true);
> > Object com = Activator.CreateInstance(myComType);
>
> > Activator.CreateInstance() always throws an exception "Class not
> > registered".
> > So, I've change the code to:
>
> > Type myComType = Type.GetTypeFromProgID(ProgId,"",true);
> > Type myComTypeEx = Type.GetTypeFromCLSID(myComType .GUID);
> > Object com = Activator.CreateInstance(myComTypeEx);
>
> > That works just fine.
> > However I must do it on a remote machine. So, I've change the code to:
> > Type myComType = Type.GetTypeFromProgID(ProgId,srvrName,true);
> > Type myComTypeEx = Type.GetTypeFromCLSID(myComType .GUID, srvrName);
> > Object com = Activator.CreateInstance(myComTypeEx);
>
> > That case Activator.CreateInstance always throws the same exception
> > "Class not registered".
>
> > You help is highly appreciated.
>
> Have you copied the .NET COM (C#) DLL over to the remote machine and
> registered it with RegAsm?
>
> --
> Patrick Steele (patr...@mvps.org)http://weblogs.asp.ne... Hide quoted text -
>
> - Show quoted text -

Since I work on the same machine (for debug purpose) I guess I have no
need for explicit registration... but yes! I explicitly registered the
DLL with RegAsm in my test with the same negative result.
I appreciate your interest and should be thankful for any help or
suggestions.
Alex

Patrick Steele

9/7/2007 2:14:00 AM

0

In article <1189012402.670440.45390@r34g2000hsd.googlegroups.com>,
lalexzh@yahoo.com says...
> Since I work on the same machine (for debug purpose) I guess I have no
> need for explicit registration... but yes! I explicitly registered the
> DLL with RegAsm in my test with the same negative result.
> I appreciate your interest and should be thankful for any help or
> suggestions.
> Alex

Are you getting any DCOM security errors in your event log?

--
Patrick Steele (patrick@mvps.org)
http://weblogs.asp.n...

FTW

1/31/2011 3:05:00 PM

0

On Jan 31, 7:39 am, GAAslin <gaas...@oricom.ca> wrote:
> Mara Jade Skywalker avait soumis l'id e :
>
> > GAAslin a os crire:
>
> >> America way of life:
> >> D troit en ruine
>
> >>http://www.howtobearetronaut.com/2011/01/detroit...
>
> > Gasslin:
> > psychotropes & hallucinog nes
>
> >http://fr.wikipedia.org/wiki/P...
>
> >http://fr.wikipedia.org/wiki/Hallucin...
>
> hallucinant l'Am rique hein Mara!

dommages collatéraux

1/31/2011 3:19:00 PM

0

On 31 jan, 16:04, FTW <monterreyblackj...@yahoo.com> wrote:
> On Jan 31, 7:39 am, GAAslin <gaas...@oricom.ca> wrote:
>
>
>
> > Mara Jade Skywalker avait soumis l'id e :
>
> > > GAAslin a os crire:
>
> > >> America way of life:
> > >> D troit en ruine
>
> > >>http://www.howtobearetronaut.com/2011/01/detroit...
>
> > > Gasslin:
> > > psychotropes & hallucinog nes
>
> > >http://fr.wikipedia.org/wiki/P...
>
> > >http://fr.wikipedia.org/wiki/Hallucin...
>
> > hallucinant l'Am rique hein Mara!- Masquer le texte des messages précédents -
>
> - Afficher le texte des messages précédents -

_______________
Vive le Québec Libre!

Re coma

2/1/2011 1:35:00 PM

0

En furetant sur ce site, j'y ai trouv? cette ?tonnante fa?on de rendre la
3D.

http://www.howtobearetronaut.com/2010/06/3d-anci...

re-Coma


"Mara Jade Skywalker" <antispam.cool@gmail.com> a ?crit dans le message de
groupe de discussion : 8qn9j9F8deU1@mid.individual.net...
> GAAslin a os? ?crire:
>
>> America way of life:
>> D?troit en ruine
>>
>> http://www.howtobearetronaut.com/2011/01/detroit...
>
> Gasslin:
> psychotropes & hallucinog?nes


petem001

2/1/2011 4:05:00 PM

0

"FTW" a ?crit dans le message de groupe de discussion :
171ff1ca-aa33-4e46-b7c4-5f0e79a51bb4@w7g2000pre.googlegroups.com...

On Jan 31, 7:39 am, GAAslin <gaas...@oricom.ca> wrote:
> Mara Jade Skywalker avait soumis l'id e :
>
> > GAAslin a os crire:
>
> >> America way of life:
> >> D troit en ruine
>
> >>http://www.howtobearetronaut.com/2011/01/detroit...
>
> > Gasslin:
> > psychotropes & hallucinog nes
>
> >http://fr.wikipedia.org/wiki/P...
>
> >http://fr.wikipedia.org/wiki/Hallucin...
>
> hallucinant l'Am rique hein Mara!


LOL!!

Vraiment je pensait les p?d?raliste, oups!! f?d?raliste moins con que ca..
c'est du passer date les campagnes de peur!!!