com +,还需要什么? [英] com+, what more are needed?

查看:54
本文介绍了com +,还需要什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好


我正在尝试使用C#在vs.net中构建一个简单的COM +应用程序,我无法在组件管理器中注册

。 ....


还需要更多:


使用系统;


使用System.EnterpriseServices;


命名空间COMTest


{


///< summary> ;


/// Class1的摘要说明。


///< / summary>


公共类Class1


{


public Class1(){}


public string WriteShit()


{


return" shite";


}


}


}

解决方案

HI Lasse,


您还必须从ServicedComponent派生您的班级。


公共班级Class1:ServicedComponent

{

// .....

}


文章将提供一个很好的概述。
http://msdn.microsoft.com/library/en...asp?frame=true

问候,

Aravind C

" Lasse Edsvik" < LA *** @ nospam.com>在消息中写道

新闻:#H ************** @ TK2MSFTNGP09.phx.gbl ...

你好

我正在尝试使用C#在vs.net中构建一个简单的COM +应用程序,并且我不能将
注册到组件管理器中.....

还有什么是需要比这个:

使用System;

使用System.EnterpriseServices;

命名空间COMTest

{

///< summary>

/// Class1的摘要说明。

///< / summary>

公共Class1(){}

公共字符串WriteShit()

{

返回shite;

}

}

}



Aravind,

i仍然得到一个或多个文件不包含组件或类型库。

无法安装这些文件 :(


我假设汇编的东西只是用于交易?


无法找到一个简单的hello world app om msdn,它是一个djungle。 .......

/ Lasse

" Aravind C" ar *********** @ nospam.hotmail .com>在留言中写道

新闻:OD ************** @ TK2MSFTNGP12.phx.gbl ...

HI Lasse ,

你还必须从ServicedComponent派生你的班级。

公共班Class1:ServicedComponent
{
// ..... }

以下文章将提供一个很好的概述。
http://msdn.microsoft.com/library/en...asp?frame=true

此致,
Aravind C

" Lasse Edsvik< la *** @ nospam.com>在消息中写道
新闻:#H ******* ******* @ TK2MSFTNGP09.phx.gbl ...

你好

我是尝试使用C#在vs.net中构建一个简单的COM +应用程序


在组件管理器中注册



还需要更多:

使用System;

使用System.EnterpriseServices;

命名空间COMTest

{

///< summary>

/// Class1的摘要说明。

///< / summary>

公共课Class1

公共Class1(){}

公共字符串WriteShit()

{

返回" shite";

}

}

}




您缺少几个步骤,基本上是程序集属性,以便懒惰

注册 ;可以出现在COM +目录中。如果没有这一步,你必须做一个明确的regsvcs.exe
。以下是我的博文中的步骤:

1 ..创建DLL项目

2 ..添加对System.EnterpriseServices的引用

3 ..添加一个使用声明:使用System.EnterpriseServices;

4 ..从ServicedComponent继承你的类(即公共小部件:

ServicedComponent)

5 ..在顶部粘贴[assembly:ApplicationName(" ComPlusApp")],以便

" COMPlusApp"或者在COM +目录中注册

时应用程序的名称。

6 ..在文件顶部粘贴一个强名称属性[assembly:

AssemblyKeyFile(" ComPlus.snk")]

7 ..转到命令行并生成一个强名称sn -k ComPlus.snk

8 ..如果你有一些执行交易的方法,把

[自动完成]放在它上面

9 ..构建 - 这将懒惰注册COM +目录中的COM +应用程序(在

某些情况下我将在以后的文章中详细介绍,你可能有

来使用regsvcs.exe ComPlusApp.dll)

10 ..创建一个引用System.EnterpriseServices的客户端并调用

你的COM +方法

11 ..运行它

请参阅 http:// samgentile。 com / blog / archive / 2003/06/25 / 7844.aspx


----

Sam Gentile [C #/。NET MVP]

..NET博客 http:// samgentile .com / blog /

MSDN专栏:
http://msdn.microsoft.com/library/de...tml/bridge.asp

请仅回复新闻组,以便其他人可以受益。

此帖子按原样提供。没有保证,也没有赋予任何权利。

------

" Lasse Edsvik" < LA *** @ nospam.com>在消息中写道

news:uS **************** @ TK2MSFTNGP09.phx.gbl ...

Aravind,

我仍然得到一个或多个文件不包含组件或键入
库。无法安装这些文件 :(

我认为汇编的东西只是用于交易?

无法找到一个简单的hello world app om msdn,它的djungle ......

/ Lasse

" Aravind C" ar *********** @ nospam.hotmail.com>在消息中写道
新闻: OD ************** @ TK2MSFTNGP12.phx.gbl ...

HI Lasse,

您还必须从ServicedComponent。

公共类Class1:ServicedComponent
{
// .....
}

以下文章将提供好的概述。


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



问候,
Aravind C

" Lasse Edsvik"< la *** @ nospam.com>写在消息中
新闻:# H**************@TK2MSFTNGP09.p hx.gbl ...

你好

我正在尝试使用C#在vs.net中构建一个简单的COM +应用程序


在组件管理器中注册

它还需要什么呢?

使用系统;
<使用System.EnterpriseServices;

命名空间COMTest

///< summary>

/// Class1的摘要描述。

///< / summary>

公共类Class1

{

public Class1(){}

public string WriteShit()



return" shite";

}

}





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.EnterpriseServices;

namespace COMTest

{

/// <summary>

/// Summary description for Class1.

/// </summary>

public class Class1

{

public Class1() {}

public string WriteShit()

{

return "shite";

}

}

}

解决方案

HI Lasse,

You must also derive your class from ServicedComponent.

public class Class1 : ServicedComponent
{
// .....
}

The following article will provide a good overview.
http://msdn.microsoft.com/library/en...asp?frame=true
Regards,
Aravind C
"Lasse Edsvik" <la***@nospam.com> wrote in message
news:#H**************@TK2MSFTNGP09.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.EnterpriseServices;

namespace COMTest

{

/// <summary>

/// Summary description for Class1.

/// </summary>

public class Class1

{

public Class1() {}

public string WriteShit()

{

return "shite";

}

}

}



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**************@TK2MSFTNGP12.phx.gbl...

HI Lasse,

You must also derive your class from ServicedComponent.

public class Class1 : ServicedComponent
{
// .....
}

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

Regards,
Aravind C
"Lasse Edsvik" <la***@nospam.com> wrote in message
news:#H**************@TK2MSFTNGP09.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.EnterpriseServices;

namespace COMTest

{

/// <summary>

/// Summary description for Class1.

/// </summary>

public class Class1

{

public Class1() {}

public string WriteShit()

{

return "shite";

}

}

}




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.EnterpriseServices
3.. Add a using declaration: using System.EnterpriseServices;
4.. Inherit your classes from ServicedComponent (i.e. public Widget :
ServicedComponent)
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.snk")]
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.EnterpriseServices 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.com> wrote in message
news:uS****************@TK2MSFTNGP09.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**************@TK2MSFTNGP12.phx.gbl...

HI Lasse,

You must also derive your class from ServicedComponent.

public class Class1 : ServicedComponent
{
// .....
}

The following article will provide a good overview.


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



Regards,
Aravind C
"Lasse Edsvik" <la***@nospam.com> wrote in message
news:#H**************@TK2MSFTNGP09.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.EnterpriseServices;

namespace COMTest

{

/// <summary>

/// Summary description for Class1.

/// </summary>

public class Class1

{

public Class1() {}

public string WriteShit()

{

return "shite";

}

}

}





这篇关于com +,还需要什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆