473,856 Members | 1,577 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

com+, what more are needed?

Hello

I'm trying to build a simple COM+ app in vs.net using C# and i cant register
it in component manager.....

what more is needed than this:

using System;

using System.Enterpri seServices;

namespace COMTest

{

/// <summary>

/// Summary description for Class1.

/// </summary>

public class Class1

{

public Class1() {}

public string WriteShit()

{

return "shite";

}

}

}
Nov 15 '05 #1
26 4521
HI Lasse,

You must also derive your class from ServicedCompone nt.

public class Class1 : ServicedCompone nt
{
// .....
}

The following article will provide a good overview.
http://msdn.microsoft.com/library/en...asp?frame=true
Regards,
Aravind C
"Lasse Edsvik" <la***@nospam.c om> wrote in message
news:#H******** ******@TK2MSFTN GP09.phx.gbl...
Hello

I'm trying to build a simple COM+ app in vs.net using C# and i cant register it in component manager.....

what more is needed than this:

using System;

using System.Enterpri seServices;

namespace COMTest

{

/// <summary>

/// Summary description for Class1.

/// </summary>

public class Class1

{

public Class1() {}

public string WriteShit()

{

return "shite";

}

}

}

Nov 15 '05 #2
Aravind,

i still get "One or more files do not contain components or type libraries.
These files cannot be installed" :(

I assume that assembly stuff is just for transactions?

cant find a simple hello world app om msdn, its a djungle......

/Lasse
"Aravind C" <ar***********@ nospam.hotmail. com> wrote in message
news:OD******** ******@TK2MSFTN GP12.phx.gbl...
HI Lasse,

You must also derive your class from ServicedCompone nt.

public class Class1 : ServicedCompone nt
{
// .....
}

The following article will provide a good overview.
http://msdn.microsoft.com/library/en...asp?frame=true

Regards,
Aravind C
"Lasse Edsvik" <la***@nospam.c om> wrote in message
news:#H******** ******@TK2MSFTN GP09.phx.gbl...
Hello

I'm trying to build a simple COM+ app in vs.net using C# and i cant

register
it in component manager.....

what more is needed than this:

using System;

using System.Enterpri seServices;

namespace COMTest

{

/// <summary>

/// Summary description for Class1.

/// </summary>

public class Class1

{

public Class1() {}

public string WriteShit()

{

return "shite";

}

}

}


Nov 15 '05 #3
You are missing a few steps, basically the assembly attributes so that "Lazy
registration" can occur in the COM+ catalog. Without that step you have to
do an explicit regsvcs.exe. Here are the steps from a blog post of mine:
1.. Create a DLL project
2.. Add a Reference to System.Enterpri seServices
3.. Add a using declaration: using System.Enterpri seServices;
4.. Inherit your classes from ServicedCompone nt (i.e. public Widget :
ServicedCompone nt)
5.. Stick an [assembly: ApplicationName ("ComPlusApp ")] at the top so that
"COMPlusApp " or whatever is the name of the application when it is
registered in the COM+ catalog.
6.. Stick a strong name attribute at the top of the file [assembly:
AssemblyKeyFile ("ComPlus.sn k")]
7.. Go to the command line and generate a Strong Name sn -k ComPlus.snk
8.. If you have some method that performs a transaction, put
[AutoComplete] on top of it
9.. Build - This will lazy register the COM+ app in the COM+ catalog (In
some circumstances I will go into detail in a future article, you may have
to do use regsvcs.exe ComPlusApp.dll)
10.. Create a client that references System.Enterpri seServices and calls
your COM+ method(s)
11.. Run it
See http://samgentile.com/blog/archive/2003/06/25/7844.aspx

----
Sam Gentile [C#/.NET MVP]
..NET Blog http://samgentile.com/blog/
MSDN Column:
http://msdn.microsoft.com/library/de...tml/bridge.asp
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
------
"Lasse Edsvik" <la***@nospam.c om> wrote in message
news:uS******** ********@TK2MSF TNGP09.phx.gbl. ..
Aravind,

i still get "One or more files do not contain components or type libraries. These files cannot be installed" :(

I assume that assembly stuff is just for transactions?

cant find a simple hello world app om msdn, its a djungle......

/Lasse
"Aravind C" <ar***********@ nospam.hotmail. com> wrote in message
news:OD******** ******@TK2MSFTN GP12.phx.gbl...
HI Lasse,

You must also derive your class from ServicedCompone nt.

public class Class1 : ServicedCompone nt
{
// .....
}

The following article will provide a good overview.

http://msdn.microsoft.com/library/en...asp?frame=true


Regards,
Aravind C
"Lasse Edsvik" <la***@nospam.c om> wrote in message
news:#H******** ******@TK2MSFTN GP09.phx.gbl...
Hello

I'm trying to build a simple COM+ app in vs.net using C# and i cant

register
it in component manager.....

what more is needed than this:

using System;

using System.Enterpri seServices;

namespace COMTest

{

/// <summary>

/// Summary description for Class1.

/// </summary>

public class Class1

{

public Class1() {}

public string WriteShit()

{

return "shite";

}

}

}



Nov 15 '05 #4
Sam,

hmm, i fail at step 9 eventhough i've created COMTest.snk, should it be in
AssemblyInfo.cs ?
looks like this now:

using System;

using System.Enterpri seServices;

[assembly: ApplicationName ("COMTest")]

[assembly: AssemblyKeyFile ("COMTest.sn k")]

namespace COMTest

{

public class Class1 : ServicedCompone nt

{

public Class1() {}

public string WriteShit()

{

return "shite";

}



in Assemblyinfo.cs its:

[assembly: AssemblyDelaySi gn(false)]

[assembly: AssemblyKeyFile ("")]

[assembly: AssemblyKeyName ("")]

"Sam Gentile [MVP]" <sa*@nomail.com > wrote in message
news:uC******** *****@TK2MSFTNG P12.phx.gbl...
You are missing a few steps, basically the assembly attributes so that "Lazy registration" can occur in the COM+ catalog. Without that step you have to
do an explicit regsvcs.exe. Here are the steps from a blog post of mine:
1.. Create a DLL project
2.. Add a Reference to System.Enterpri seServices
3.. Add a using declaration: using System.Enterpri seServices;
4.. Inherit your classes from ServicedCompone nt (i.e. public Widget :
ServicedCompone nt)
5.. Stick an [assembly: ApplicationName ("ComPlusApp ")] at the top so that "COMPlusApp " or whatever is the name of the application when it is
registered in the COM+ catalog.
6.. Stick a strong name attribute at the top of the file [assembly:
AssemblyKeyFile ("ComPlus.sn k")]
7.. Go to the command line and generate a Strong Name sn -k ComPlus.snk
8.. If you have some method that performs a transaction, put
[AutoComplete] on top of it
9.. Build - This will lazy register the COM+ app in the COM+ catalog (In
some circumstances I will go into detail in a future article, you may have
to do use regsvcs.exe ComPlusApp.dll)
10.. Create a client that references System.Enterpri seServices and calls
your COM+ method(s)
11.. Run it
See http://samgentile.com/blog/archive/2003/06/25/7844.aspx

----
Sam Gentile [C#/.NET MVP]
.NET Blog http://samgentile.com/blog/
MSDN Column:
http://msdn.microsoft.com/library/de...tml/bridge.asp Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights. ------
"Lasse Edsvik" <la***@nospam.c om> wrote in message
news:uS******** ********@TK2MSF TNGP09.phx.gbl. ..
Aravind,

i still get "One or more files do not contain components or type

libraries.
These files cannot be installed" :(

I assume that assembly stuff is just for transactions?

cant find a simple hello world app om msdn, its a djungle......

/Lasse
"Aravind C" <ar***********@ nospam.hotmail. com> wrote in message
news:OD******** ******@TK2MSFTN GP12.phx.gbl...
HI Lasse,

You must also derive your class from ServicedCompone nt.

public class Class1 : ServicedCompone nt
{
// .....
}

The following article will provide a good overview.

http://msdn.microsoft.com/library/en...asp?frame=true


Regards,
Aravind C
"Lasse Edsvik" <la***@nospam.c om> wrote in message
news:#H******** ******@TK2MSFTN GP09.phx.gbl...
> Hello
>
> I'm trying to build a simple COM+ app in vs.net using C# and i cant
register
> it in component manager.....
>
> what more is needed than this:
>
> using System;
>
> using System.Enterpri seServices;
>
> namespace COMTest
>
> {
>
> /// <summary>
>
> /// Summary description for Class1.
>
> /// </summary>
>
> public class Class1
>
> {
>
> public Class1() {}
>
> public string WriteShit()
>
> {
>
> return "shite";
>
> }
>
> }
>
> }
>
>



Nov 15 '05 #5
Are you creating a COM+ server or library component? It makes a difference.
This is controlled by:
[assembly: ApplicationActi vation(Activati onOption.Server )]

Or

[assembly: ApplicationActi vation(Activati onOption.Librar y)]

While convenient, the lazy registration in step 9 does not work in many
scenarios as it requires Admin rights as well as other issues. So really the
right way. So the correct way that will work in all scenarios is replace
step 9 by:

9) gacutil.exe - i COMtest.dll (this puts it in the GAC)

10) regsvcs.exe COMtest.sll (this makes it a configured
coomponent in the COM+ catalog)
--
Sam Gentile [C#/.NET MVP]
..NET Blog http://samgentile.com/blog/
MSDN Column:
http://msdn.microsoft.com/library/de...tml/bridge.asp
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
"Lasse Edsvik" <la***@nospam.c om> wrote in message
news:%2******** ********@TK2MSF TNGP10.phx.gbl. ..
Sam,

hmm, i fail at step 9 eventhough i've created COMTest.snk, should it be in
AssemblyInfo.cs ?
looks like this now:

using System;

using System.Enterpri seServices;

[assembly: ApplicationName ("COMTest")]

[assembly: AssemblyKeyFile ("COMTest.sn k")]

namespace COMTest

{

public class Class1 : ServicedCompone nt

{

public Class1() {}

public string WriteShit()

{

return "shite";

}



in Assemblyinfo.cs its:

[assembly: AssemblyDelaySi gn(false)]

[assembly: AssemblyKeyFile ("")]

[assembly: AssemblyKeyName ("")]

"Sam Gentile [MVP]" <sa*@nomail.com > wrote in message
news:uC******** *****@TK2MSFTNG P12.phx.gbl...
You are missing a few steps, basically the assembly attributes so that

"Lazy
registration" can occur in the COM+ catalog. Without that step you have to
do an explicit regsvcs.exe. Here are the steps from a blog post of mine:
1.. Create a DLL project
2.. Add a Reference to System.Enterpri seServices
3.. Add a using declaration: using System.Enterpri seServices;
4.. Inherit your classes from ServicedCompone nt (i.e. public Widget :
ServicedCompone nt)
5.. Stick an [assembly: ApplicationName ("ComPlusApp ")] at the top so

that
"COMPlusApp " or whatever is the name of the application when it is
registered in the COM+ catalog.
6.. Stick a strong name attribute at the top of the file [assembly:
AssemblyKeyFile ("ComPlus.sn k")]
7.. Go to the command line and generate a Strong Name sn -k ComPlus.snk 8.. If you have some method that performs a transaction, put
[AutoComplete] on top of it
9.. Build - This will lazy register the COM+ app in the COM+ catalog (In some circumstances I will go into detail in a future article, you may have to do use regsvcs.exe ComPlusApp.dll)
10.. Create a client that references System.Enterpri seServices and calls your COM+ method(s)
11.. Run it
See http://samgentile.com/blog/archive/2003/06/25/7844.aspx

----
Sam Gentile [C#/.NET MVP]
.NET Blog http://samgentile.com/blog/
MSDN Column:

http://msdn.microsoft.com/library/de...tml/bridge.asp
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no

rights.
------
"Lasse Edsvik" <la***@nospam.c om> wrote in message
news:uS******** ********@TK2MSF TNGP09.phx.gbl. ..
Aravind,

i still get "One or more files do not contain components or type

libraries.
These files cannot be installed" :(

I assume that assembly stuff is just for transactions?

cant find a simple hello world app om msdn, its a djungle......

/Lasse
"Aravind C" <ar***********@ nospam.hotmail. com> wrote in message
news:OD******** ******@TK2MSFTN GP12.phx.gbl...
> HI Lasse,
>
> You must also derive your class from ServicedCompone nt.
>
> public class Class1 : ServicedCompone nt
> {
> // .....
> }
>
> The following article will provide a good overview.
>

http://msdn.microsoft.com/library/en...asp?frame=true
>
>
> Regards,
> Aravind C
>
>
> "Lasse Edsvik" <la***@nospam.c om> wrote in message
> news:#H******** ******@TK2MSFTN GP09.phx.gbl...
> > Hello
> >
> > I'm trying to build a simple COM+ app in vs.net using C# and i cant > register
> > it in component manager.....
> >
> > what more is needed than this:
> >
> > using System;
> >
> > using System.Enterpri seServices;
> >
> > namespace COMTest
> >
> > {
> >
> > /// <summary>
> >
> > /// Summary description for Class1.
> >
> > /// </summary>
> >
> > public class Class1
> >
> > {
> >
> > public Class1() {}
> >
> > public string WriteShit()
> >
> > {
> >
> > return "shite";
> >
> > }
> >
> > }
> >
> > }
> >
> >
>
>



Nov 15 '05 #6
I've updated my blog topic.

--
Sam Gentile [C#/.NET MVP]
..NET Blog http://samgentile.com/blog/
MSDN Column:
http://msdn.microsoft.com/library/de...tml/bridge.asp
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.

"Sam Gentile [MVP]" <sa*@nomail.com > wrote in message
news:en******** ******@TK2MSFTN GP10.phx.gbl...
Are you creating a COM+ server or library component? It makes a difference. This is controlled by:
[assembly: ApplicationActi vation(Activati onOption.Server )]

Or

[assembly: ApplicationActi vation(Activati onOption.Librar y)]

While convenient, the lazy registration in step 9 does not work in many
scenarios as it requires Admin rights as well as other issues. So really the right way. So the correct way that will work in all scenarios is replace
step 9 by:

9) gacutil.exe - i COMtest.dll (this puts it in the GAC)

10) regsvcs.exe COMtest.sll (this makes it a configured
coomponent in the COM+ catalog)
--
Sam Gentile [C#/.NET MVP]
.NET Blog http://samgentile.com/blog/
MSDN Column:
http://msdn.microsoft.com/library/de...tml/bridge.asp Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights. "Lasse Edsvik" <la***@nospam.c om> wrote in message
news:%2******** ********@TK2MSF TNGP10.phx.gbl. ..
Sam,

hmm, i fail at step 9 eventhough i've created COMTest.snk, should it be in
AssemblyInfo.cs ?
looks like this now:

using System;

using System.Enterpri seServices;

[assembly: ApplicationName ("COMTest")]

[assembly: AssemblyKeyFile ("COMTest.sn k")]

namespace COMTest

{

public class Class1 : ServicedCompone nt

{

public Class1() {}

public string WriteShit()

{

return "shite";

}



in Assemblyinfo.cs its:

[assembly: AssemblyDelaySi gn(false)]

[assembly: AssemblyKeyFile ("")]

[assembly: AssemblyKeyName ("")]

"Sam Gentile [MVP]" <sa*@nomail.com > wrote in message
news:uC******** *****@TK2MSFTNG P12.phx.gbl...
You are missing a few steps, basically the assembly attributes so that "Lazy
registration" can occur in the COM+ catalog. Without that step you have to do an explicit regsvcs.exe. Here are the steps from a blog post of
mine: 1.. Create a DLL project
2.. Add a Reference to System.Enterpri seServices
3.. Add a using declaration: using System.Enterpri seServices;
4.. Inherit your classes from ServicedCompone nt (i.e. public Widget : ServicedCompone nt)
5.. Stick an [assembly: ApplicationName ("ComPlusApp ")] at the top so

that
"COMPlusApp " or whatever is the name of the application when it is
registered in the COM+ catalog.
6.. Stick a strong name attribute at the top of the file [assembly:
AssemblyKeyFile ("ComPlus.sn k")]
7.. Go to the command line and generate a Strong Name sn -k

ComPlus.snk 8.. If you have some method that performs a transaction, put
[AutoComplete] on top of it
9.. Build - This will lazy register the COM+ app in the COM+ catalog (In some circumstances I will go into detail in a future article, you may have to do use regsvcs.exe ComPlusApp.dll)
10.. Create a client that references System.Enterpri seServices and calls your COM+ method(s)
11.. Run it
See http://samgentile.com/blog/archive/2003/06/25/7844.aspx

----
Sam Gentile [C#/.NET MVP]
.NET Blog http://samgentile.com/blog/
MSDN Column:

http://msdn.microsoft.com/library/de...tml/bridge.asp
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no

rights.
------
"Lasse Edsvik" <la***@nospam.c om> wrote in message
news:uS******** ********@TK2MSF TNGP09.phx.gbl. ..
> Aravind,
>
> i still get "One or more files do not contain components or type
libraries.
> These files cannot be installed" :(
>
> I assume that assembly stuff is just for transactions?
>
> cant find a simple hello world app om msdn, its a djungle......
>
> /Lasse
>
>
> "Aravind C" <ar***********@ nospam.hotmail. com> wrote in message
> news:OD******** ******@TK2MSFTN GP12.phx.gbl...
> > HI Lasse,
> >
> > You must also derive your class from ServicedCompone nt.
> >
> > public class Class1 : ServicedCompone nt
> > {
> > // .....
> > }
> >
> > The following article will provide a good overview.
> >
>

http://msdn.microsoft.com/library/en...asp?frame=true
> >
> >
> > Regards,
> > Aravind C
> >
> >
> > "Lasse Edsvik" <la***@nospam.c om> wrote in message
> > news:#H******** ******@TK2MSFTN GP09.phx.gbl...
> > > Hello
> > >
> > > I'm trying to build a simple COM+ app in vs.net using C# and i cant > > register
> > > it in component manager.....
> > >
> > > what more is needed than this:
> > >
> > > using System;
> > >
> > > using System.Enterpri seServices;
> > >
> > > namespace COMTest
> > >
> > > {
> > >
> > > /// <summary>
> > >
> > > /// Summary description for Class1.
> > >
> > > /// </summary>
> > >
> > > public class Class1
> > >
> > > {
> > >
> > > public Class1() {}
> > >
> > > public string WriteShit()
> > >
> > > {
> > >
> > > return "shite";
> > >
> > > }
> > >
> > > }
> > >
> > > }
> > >
> > >
> >
> >
>
>



Nov 15 '05 #7
Sam,

trying to build a simple COM app that i'll use in regular ASP-pages

/Lasse
"Sam Gentile [MVP]" <sa*@nomail.com > wrote in message
news:en******** ******@TK2MSFTN GP10.phx.gbl...
Are you creating a COM+ server or library component? It makes a difference. This is controlled by:
[assembly: ApplicationActi vation(Activati onOption.Server )]

Or

[assembly: ApplicationActi vation(Activati onOption.Librar y)]

While convenient, the lazy registration in step 9 does not work in many
scenarios as it requires Admin rights as well as other issues. So really the right way. So the correct way that will work in all scenarios is replace
step 9 by:

9) gacutil.exe - i COMtest.dll (this puts it in the GAC)

10) regsvcs.exe COMtest.sll (this makes it a configured
coomponent in the COM+ catalog)
--
Sam Gentile [C#/.NET MVP]
.NET Blog http://samgentile.com/blog/
MSDN Column:
http://msdn.microsoft.com/library/de...tml/bridge.asp Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights. "Lasse Edsvik" <la***@nospam.c om> wrote in message
news:%2******** ********@TK2MSF TNGP10.phx.gbl. ..
Sam,

hmm, i fail at step 9 eventhough i've created COMTest.snk, should it be in
AssemblyInfo.cs ?
looks like this now:

using System;

using System.Enterpri seServices;

[assembly: ApplicationName ("COMTest")]

[assembly: AssemblyKeyFile ("COMTest.sn k")]

namespace COMTest

{

public class Class1 : ServicedCompone nt

{

public Class1() {}

public string WriteShit()

{

return "shite";

}



in Assemblyinfo.cs its:

[assembly: AssemblyDelaySi gn(false)]

[assembly: AssemblyKeyFile ("")]

[assembly: AssemblyKeyName ("")]

"Sam Gentile [MVP]" <sa*@nomail.com > wrote in message
news:uC******** *****@TK2MSFTNG P12.phx.gbl...
You are missing a few steps, basically the assembly attributes so that "Lazy
registration" can occur in the COM+ catalog. Without that step you have to do an explicit regsvcs.exe. Here are the steps from a blog post of
mine: 1.. Create a DLL project
2.. Add a Reference to System.Enterpri seServices
3.. Add a using declaration: using System.Enterpri seServices;
4.. Inherit your classes from ServicedCompone nt (i.e. public Widget : ServicedCompone nt)
5.. Stick an [assembly: ApplicationName ("ComPlusApp ")] at the top so

that
"COMPlusApp " or whatever is the name of the application when it is
registered in the COM+ catalog.
6.. Stick a strong name attribute at the top of the file [assembly:
AssemblyKeyFile ("ComPlus.sn k")]
7.. Go to the command line and generate a Strong Name sn -k

ComPlus.snk 8.. If you have some method that performs a transaction, put
[AutoComplete] on top of it
9.. Build - This will lazy register the COM+ app in the COM+ catalog (In some circumstances I will go into detail in a future article, you may have to do use regsvcs.exe ComPlusApp.dll)
10.. Create a client that references System.Enterpri seServices and calls your COM+ method(s)
11.. Run it
See http://samgentile.com/blog/archive/2003/06/25/7844.aspx

----
Sam Gentile [C#/.NET MVP]
.NET Blog http://samgentile.com/blog/
MSDN Column:

http://msdn.microsoft.com/library/de...tml/bridge.asp
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no

rights.
------
"Lasse Edsvik" <la***@nospam.c om> wrote in message
news:uS******** ********@TK2MSF TNGP09.phx.gbl. ..
> Aravind,
>
> i still get "One or more files do not contain components or type
libraries.
> These files cannot be installed" :(
>
> I assume that assembly stuff is just for transactions?
>
> cant find a simple hello world app om msdn, its a djungle......
>
> /Lasse
>
>
> "Aravind C" <ar***********@ nospam.hotmail. com> wrote in message
> news:OD******** ******@TK2MSFTN GP12.phx.gbl...
> > HI Lasse,
> >
> > You must also derive your class from ServicedCompone nt.
> >
> > public class Class1 : ServicedCompone nt
> > {
> > // .....
> > }
> >
> > The following article will provide a good overview.
> >
>

http://msdn.microsoft.com/library/en...asp?frame=true
> >
> >
> > Regards,
> > Aravind C
> >
> >
> > "Lasse Edsvik" <la***@nospam.c om> wrote in message
> > news:#H******** ******@TK2MSFTN GP09.phx.gbl...
> > > Hello
> > >
> > > I'm trying to build a simple COM+ app in vs.net using C# and i cant > > register
> > > it in component manager.....
> > >
> > > what more is needed than this:
> > >
> > > using System;
> > >
> > > using System.Enterpri seServices;
> > >
> > > namespace COMTest
> > >
> > > {
> > >
> > > /// <summary>
> > >
> > > /// Summary description for Class1.
> > >
> > > /// </summary>
> > >
> > > public class Class1
> > >
> > > {
> > >
> > > public Class1() {}
> > >
> > > public string WriteShit()
> > >
> > > {
> > >
> > > return "shite";
> > >
> > > }
> > >
> > > }
> > >
> > > }
> > >
> > >
> >
> >
>
>



Nov 15 '05 #8
I got this error when building it:

Cryptographic failure while signing assembly 'C:\Documents and
Settings\Admini strator\My Documents\Visua l Studio
Projects\COMTes t\obj\Release\C OMTest.dll' -- 'The key container name
'COMPlus' does not exist'


"Sam Gentile [MVP]" <sa*@nomail.com > wrote in message
news:eT******** ******@tk2msftn gp13.phx.gbl...
I've updated my blog topic.

--
Sam Gentile [C#/.NET MVP]
.NET Blog http://samgentile.com/blog/
MSDN Column:
http://msdn.microsoft.com/library/de...tml/bridge.asp Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
"Sam Gentile [MVP]" <sa*@nomail.com > wrote in message
news:en******** ******@TK2MSFTN GP10.phx.gbl...
Are you creating a COM+ server or library component? It makes a difference.
This is controlled by:
[assembly: ApplicationActi vation(Activati onOption.Server )]

Or

[assembly: ApplicationActi vation(Activati onOption.Librar y)]

While convenient, the lazy registration in step 9 does not work in many
scenarios as it requires Admin rights as well as other issues. So really

the
right way. So the correct way that will work in all scenarios is replace
step 9 by:

9) gacutil.exe - i COMtest.dll (this puts it in the GAC)

10) regsvcs.exe COMtest.sll (this makes it a configured
coomponent in the COM+ catalog)
--
Sam Gentile [C#/.NET MVP]
.NET Blog http://samgentile.com/blog/
MSDN Column:

http://msdn.microsoft.com/library/de...tml/bridge.asp
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no

rights.
"Lasse Edsvik" <la***@nospam.c om> wrote in message
news:%2******** ********@TK2MSF TNGP10.phx.gbl. ..
Sam,

hmm, i fail at step 9 eventhough i've created COMTest.snk, should it be in
AssemblyInfo.cs ?
looks like this now:

using System;

using System.Enterpri seServices;

[assembly: ApplicationName ("COMTest")]

[assembly: AssemblyKeyFile ("COMTest.sn k")]

namespace COMTest

{

public class Class1 : ServicedCompone nt

{

public Class1() {}

public string WriteShit()

{

return "shite";

}



in Assemblyinfo.cs its:

[assembly: AssemblyDelaySi gn(false)]

[assembly: AssemblyKeyFile ("")]

[assembly: AssemblyKeyName ("")]

"Sam Gentile [MVP]" <sa*@nomail.com > wrote in message
news:uC******** *****@TK2MSFTNG P12.phx.gbl...
> You are missing a few steps, basically the assembly attributes so
that "Lazy
> registration" can occur in the COM+ catalog. Without that step you have
to
> do an explicit regsvcs.exe. Here are the steps from a blog post of
mine: > 1.. Create a DLL project
> 2.. Add a Reference to System.Enterpri seServices
> 3.. Add a using declaration: using System.Enterpri seServices;
> 4.. Inherit your classes from ServicedCompone nt (i.e. public Widget :
> ServicedCompone nt)
> 5.. Stick an [assembly: ApplicationName ("ComPlusApp ")] at the top
so that
> "COMPlusApp " or whatever is the name of the application when it is
> registered in the COM+ catalog.
> 6.. Stick a strong name attribute at the top of the file [assembly: > AssemblyKeyFile ("ComPlus.sn k")]
> 7.. Go to the command line and generate a Strong Name sn -k

ComPlus.snk
> 8.. If you have some method that performs a transaction, put
> [AutoComplete] on top of it
> 9.. Build - This will lazy register the COM+ app in the COM+ catalog (In
> some circumstances I will go into detail in a future article, you
may have
> to do use regsvcs.exe ComPlusApp.dll)
> 10.. Create a client that references System.Enterpri seServices and

calls
> your COM+ method(s)
> 11.. Run it
> See http://samgentile.com/blog/archive/2003/06/25/7844.aspx
>
> ----
> Sam Gentile [C#/.NET MVP]
> .NET Blog http://samgentile.com/blog/
> MSDN Column:
>

http://msdn.microsoft.com/library/de...tml/bridge.asp > Please reply only to the newsgroup so that others can benefit.
> This posting is provided "AS IS" with no warranties, and confers no
rights.
> ------
>
>
> "Lasse Edsvik" <la***@nospam.c om> wrote in message
> news:uS******** ********@TK2MSF TNGP09.phx.gbl. ..
> > Aravind,
> >
> > i still get "One or more files do not contain components or type
> libraries.
> > These files cannot be installed" :(
> >
> > I assume that assembly stuff is just for transactions?
> >
> > cant find a simple hello world app om msdn, its a djungle......
> >
> > /Lasse
> >
> >
> > "Aravind C" <ar***********@ nospam.hotmail. com> wrote in message
> > news:OD******** ******@TK2MSFTN GP12.phx.gbl...
> > > HI Lasse,
> > >
> > > You must also derive your class from ServicedCompone nt.
> > >
> > > public class Class1 : ServicedCompone nt
> > > {
> > > // .....
> > > }
> > >
> > > The following article will provide a good overview.
> > >
> >
>

http://msdn.microsoft.com/library/en...asp?frame=true
> > >
> > >
> > > Regards,
> > > Aravind C
> > >
> > >
> > > "Lasse Edsvik" <la***@nospam.c om> wrote in message
> > > news:#H******** ******@TK2MSFTN GP09.phx.gbl...
> > > > Hello
> > > >
> > > > I'm trying to build a simple COM+ app in vs.net using C# and i

cant
> > > register
> > > > it in component manager.....
> > > >
> > > > what more is needed than this:
> > > >
> > > > using System;
> > > >
> > > > using System.Enterpri seServices;
> > > >
> > > > namespace COMTest
> > > >
> > > > {
> > > >
> > > > /// <summary>
> > > >
> > > > /// Summary description for Class1.
> > > >
> > > > /// </summary>
> > > >
> > > > public class Class1
> > > >
> > > > {
> > > >
> > > > public Class1() {}
> > > >
> > > > public string WriteShit()
> > > >
> > > > {
> > > >
> > > > return "shite";
> > > >
> > > > }
> > > >
> > > > }
> > > >
> > > > }
> > > >
> > > >
> > >
> > >
> >
> >
>
>



Nov 15 '05 #9
C:\Documents and Settings\Admini strator\My Documents\Visua l Studio
Projects\COMTes t\COMTest.cs(7) : The type or namespace name 'AssemblyKeyFil e'
could not be found (are you missing a using directive or an assembly
reference?)
and that one....... :(

/Lasse
"Lasse Edsvik" <la***@nospam.c om> wrote in message
news:eU******** ******@TK2MSFTN GP12.phx.gbl...
I got this error when building it:

Cryptographic failure while signing assembly 'C:\Documents and
Settings\Admini strator\My Documents\Visua l Studio
Projects\COMTes t\obj\Release\C OMTest.dll' -- 'The key container name
'COMPlus' does not exist'


"Sam Gentile [MVP]" <sa*@nomail.com > wrote in message
news:eT******** ******@tk2msftn gp13.phx.gbl...
I've updated my blog topic.

--
Sam Gentile [C#/.NET MVP]
.NET Blog http://samgentile.com/blog/
MSDN Column:

http://msdn.microsoft.com/library/de...tml/bridge.asp
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no

rights.

"Sam Gentile [MVP]" <sa*@nomail.com > wrote in message
news:en******** ******@TK2MSFTN GP10.phx.gbl...
Are you creating a COM+ server or library component? It makes a

difference.
This is controlled by:
[assembly: ApplicationActi vation(Activati onOption.Server )]

Or

[assembly: ApplicationActi vation(Activati onOption.Librar y)]

While convenient, the lazy registration in step 9 does not work in many scenarios as it requires Admin rights as well as other issues. So really
the
right way. So the correct way that will work in all scenarios is
replace step 9 by:

9) gacutil.exe - i COMtest.dll (this puts it in the GAC)

10) regsvcs.exe COMtest.sll (this makes it a configured
coomponent in the COM+ catalog)
--
Sam Gentile [C#/.NET MVP]
.NET Blog http://samgentile.com/blog/
MSDN Column:

http://msdn.microsoft.com/library/de...tml/bridge.asp
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no

rights.
"Lasse Edsvik" <la***@nospam.c om> wrote in message
news:%2******** ********@TK2MSF TNGP10.phx.gbl. ..
> Sam,
>
> hmm, i fail at step 9 eventhough i've created COMTest.snk, should it be
in
> AssemblyInfo.cs ?
>
>
> looks like this now:
>
> using System;
>
> using System.Enterpri seServices;
>
> [assembly: ApplicationName ("COMTest")]
>
> [assembly: AssemblyKeyFile ("COMTest.sn k")]
>
> namespace COMTest
>
> {
>
> public class Class1 : ServicedCompone nt
>
> {
>
> public Class1() {}
>
> public string WriteShit()
>
> {
>
> return "shite";
>
> }
>
>
>
>
>
>
>
> in Assemblyinfo.cs its:
>
>
>
>
>
> [assembly: AssemblyDelaySi gn(false)]
>
> [assembly: AssemblyKeyFile ("")]
>
> [assembly: AssemblyKeyName ("")]
>
>
>
>
>
> "Sam Gentile [MVP]" <sa*@nomail.com > wrote in message
> news:uC******** *****@TK2MSFTNG P12.phx.gbl...
> > You are missing a few steps, basically the assembly attributes so

that > "Lazy
> > registration" can occur in the COM+ catalog. Without that step you

have
to
> > do an explicit regsvcs.exe. Here are the steps from a blog post of

mine:
> > 1.. Create a DLL project
> > 2.. Add a Reference to System.Enterpri seServices
> > 3.. Add a using declaration: using System.Enterpri seServices;
> > 4.. Inherit your classes from ServicedCompone nt (i.e. public Widget
:
> > ServicedCompone nt)
> > 5.. Stick an [assembly: ApplicationName ("ComPlusApp ")] at the top so > that
> > "COMPlusApp " or whatever is the name of the application when it is
> > registered in the COM+ catalog.
> > 6.. Stick a strong name attribute at the top of the file [assembly: > > AssemblyKeyFile ("ComPlus.sn k")]
> > 7.. Go to the command line and generate a Strong Name sn -k
ComPlus.snk
> > 8.. If you have some method that performs a transaction, put
> > [AutoComplete] on top of it
> > 9.. Build - This will lazy register the COM+ app in the COM+ catalog (In
> > some circumstances I will go into detail in a future article, you may have
> > to do use regsvcs.exe ComPlusApp.dll)
> > 10.. Create a client that references System.Enterpri seServices
and calls
> > your COM+ method(s)
> > 11.. Run it
> > See http://samgentile.com/blog/archive/2003/06/25/7844.aspx
> >
> > ----
> > Sam Gentile [C#/.NET MVP]
> > .NET Blog http://samgentile.com/blog/
> > MSDN Column:
> >
>

http://msdn.microsoft.com/library/de...tml/bridge.asp
> > Please reply only to the newsgroup so that others can benefit.
> > This posting is provided "AS IS" with no warranties, and confers no > rights.
> > ------
> >
> >
> > "Lasse Edsvik" <la***@nospam.c om> wrote in message
> > news:uS******** ********@TK2MSF TNGP09.phx.gbl. ..
> > > Aravind,
> > >
> > > i still get "One or more files do not contain components or type
> > libraries.
> > > These files cannot be installed" :(
> > >
> > > I assume that assembly stuff is just for transactions?
> > >
> > > cant find a simple hello world app om msdn, its a djungle......
> > >
> > > /Lasse
> > >
> > >
> > > "Aravind C" <ar***********@ nospam.hotmail. com> wrote in message
> > > news:OD******** ******@TK2MSFTN GP12.phx.gbl...
> > > > HI Lasse,
> > > >
> > > > You must also derive your class from ServicedCompone nt.
> > > >
> > > > public class Class1 : ServicedCompone nt
> > > > {
> > > > // .....
> > > > }
> > > >
> > > > The following article will provide a good overview.
> > > >
> > >
> >
>

http://msdn.microsoft.com/library/en...asp?frame=true
> > > >
> > > >
> > > > Regards,
> > > > Aravind C
> > > >
> > > >
> > > > "Lasse Edsvik" <la***@nospam.c om> wrote in message
> > > > news:#H******** ******@TK2MSFTN GP09.phx.gbl...
> > > > > Hello
> > > > >
> > > > > I'm trying to build a simple COM+ app in vs.net using C# and i cant
> > > > register
> > > > > it in component manager.....
> > > > >
> > > > > what more is needed than this:
> > > > >
> > > > > using System;
> > > > >
> > > > > using System.Enterpri seServices;
> > > > >
> > > > > namespace COMTest
> > > > >
> > > > > {
> > > > >
> > > > > /// <summary>
> > > > >
> > > > > /// Summary description for Class1.
> > > > >
> > > > > /// </summary>
> > > > >
> > > > > public class Class1
> > > > >
> > > > > {
> > > > >
> > > > > public Class1() {}
> > > > >
> > > > > public string WriteShit()
> > > > >
> > > > > {
> > > > >
> > > > > return "shite";
> > > > >
> > > > > }
> > > > >
> > > > > }
> > > > >
> > > > > }
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>



Nov 15 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

303
17884
by: mike420 | last post by:
In the context of LATEX, some Pythonista asked what the big successes of Lisp were. I think there were at least three *big* successes. a. orbitz.com web site uses Lisp for algorithms, etc. b. Yahoo store was originally written in Lisp. c. Emacs The issues with these will probably come up, so I might as well mention them myself (which will also make this a more balanced
5
3992
by: Brian Hlubocky | last post by:
I'm have a fairly simple (in terms of COM) python program that pulls info from an Access database and creates Outlook contacts from that information. It uses wxPython for gui and works without problems. I want to be able to distribute this program using py2exe, but I am having some problems. I am using a simple setup.py like in the documentation for the py2exe tool and everything compiles ok, except that when I run the exe, I get an...
0
1521
by: Sean McKaharay | last post by:
I am using the code below and I am getting this error: "Insufficient state to deserialize the object. More information is needed." Has anyone seen this? It is working with other dll's but not on a certain one. Can some help? private void LoadAssembly(string DllLocationDirectory, string applicationName, bool shadowCopyFiles, string friendlyName, string dllName,
11
2611
by: Micha | last post by:
Hello there, I think I've run into some classic c++ pitfall and maybe some of you guys can help me out. For my project I will need to use matrices and vectors and so I decided to implement them by myself. I know there are already tons of vector and matrix implementations, but I wanted to have one taylored for my needs and without debugging someones else code. Also is's become somewhat personal meanwhile ;-).
0
1586
by: athens.gr. | last post by:
VIRTUALIZATION ENGINE CONSOLE A RUNTIME 1.1 - IBM (3 CDs), WEBSPHERE BUSINESS INTEGRATION CONNECT ADVANCED v4.2.2 - IBM, other 16,000 more CDs, (free donge)! No time limitation! 03/Sep/2004 B12 VIRTUALIZATION ENGINE CONSOLE A RUNTIME 1.1 - IBM (3 CDs) B13 WEBSPHERE BUSINESS INTEGRATION CONNECT ADVANCED v4.2.2 - IBM
4
3297
by: Koen | last post by:
Hi all, At work I created a database which is really helpful. The database is used by approx 15 users. Everything worked great, until I added some 'scoreboard' forms and reports. I get the "Cannot open any more databases" error. The 'scoreboard' form show a matrix of 6 columns, 7 rows. Each cell is calculated separate by (what I call complex) queries.
4
3033
by: Steve Jorgensen | last post by:
I'm restarting this thread with a different focus. The project I'm working on now id coming along and will be made to work, and it's too late to start over with a new strategy. Still, I'm not coming to a firm conclusion over whether it was the better approach, and wonder if I should do it differently the next time I'm faced with a similar issue. I needed an app to automatically import from spreadsheets with a semi-dynamic structure,...
38
2317
by: Mark Dickinson | last post by:
I get the following behaviour on Python 2.5 (OS X 10.4.8 on PowerPC, in case it's relevant.) (0.0, 0.0) (-0.0, -0.0) I would have expected y to be -0.0 in the first case, and 0.0 in the second. Should the above be considered a bug, or is Python not expected to honour signs of zeros? I'm working in a situation involving complex arithmetic where branch cuts, and hence signed
82
3756
by: Bill David | last post by:
SUBJECT: How to make this program more efficient? In my program, a thread will check update from server periodically and generate a stl::map for other part of this program to read data from. Let's name the update method as doUpdate and stl::map read methods as getData and copyData. Since stl::map is not thread-safe, we should do synchronization by ourselves. A usable solution is to create a boost::mutex::scoped_lock object in all above...
0
11065
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10700
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10795
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7934
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5763
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5962
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4581
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4177
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3203
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.