如何开发类库? [英] How to develop class library?

查看:41
本文介绍了如何开发类库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




开发类库的最佳方法是什么?

我计划开发几个类,我们需要它们公司

环境。

这些classe将在以后的几个项目中使用。


是否有任何如何有关如何使用visual studio的链接?

最好是有一个Windows吗?或控制台应用程序开发和/ b $ b测试每个类,然后将其放入库中,或者是否有可能使用b $ b来创建一个可以包含在测试应用程序中的库项目

因此仍然可以调试吗?


感谢提示,链接和帮助。


问候

Rainer Queck

Hi,

What would be the best way to develop a class library?
I am planing to develop a couple of classes, needed in our company
enviroment.
These classe will be later used in several projects.

Are there any "how to" links available on how to do that with visual studio?
Would it be best to have a "Windows" or "Console" application to develop and
test each class and then put it into a library later on or is it possible to
have a Library project that can be included into a test application and
thereby still be debuggable?

Thanks for hint, links and help.

Regards
Rainer Queck

推荐答案

当你开始新的

解决方案时,只需在VS中选择类库项目类型。


要测试它,您需要将一个Windows.Forms或Console项目添加到您的

解决方案中,您可以将其作为客户端构建班级图书馆。将它作为解决方案的

启动项目。无论你使用Windows.Forms项目

还是一个Console项目都没有什么区别,只要它练习了你库中所有类的所有方法,按照你的
测试计划。它仅用于测试目的。所以这取决于你:无论你是什么,你都会感到最开心。


你有测试计划,不是吗? :0)


确保库中的所有类都在同一个命名空间中:并且

明智地选择你的命名空间。这可能比在同一个程序集中使用所有

类更重要。我会确保所有组成库(命名空间)的组件都已签名,这样它们就可以部署到GAC的
。这将有助于您进行版本控制。


当然,您可以随时执行相反的操作,并使用测试可执行文件启动您的

解决方案,然后再包含另一个您的

库的项目(右键单击解决方案-Add -new项目,然后选择

类库)。正如Perl家伙所说,TMTOWTDI。结果将是

完全一样。


HTH

彼得

" Rainer Queck" < Ra **** @ noemail.noemailwrote in message

news:eA ************** @ TK2MSFTNGP05.phx.gbl ...
Just select the Class Library project type in VS when you start your new
solution.

To test it you''ll want to add a Windows.Forms or Console project to your
solution that you can build as a client for your class library. Make it the
startup project for your solution. Whether you use a Windows.Forms project
or a Console project makes absolutely no difference, as long as it exercises
all the methods of all the classes in your library, in accordance with your
test plan. It''s only for test purposes. So it''s up to you: whatever you
feel happiest with.

You do have a test plan, don''t you? :0)

Make sure all your classes in your library are in the same namespace: and
pick your namespace wisely. This is probably more important than having all
the classes in the same assembly. I''d make sure all the assemblies that
make up the library (namespace) were signed, so that they can be deployed to
the GAC. This will help you with versioning.

Of course you could always do things the other way around and start your
solution with the test executable and then include another project for your
library (right click on the solution -Add -new project, and then select
"Class library"). As the Perl guys say, "TMTOWTDI". The end result will be
exactly the same.

HTH
Peter
"Rainer Queck" <Ra****@noemail.noemailwrote in message
news:eA**************@TK2MSFTNGP05.phx.gbl...




开发类库的最佳方法是什么?

我正在计划开发一些我们公司需要的课程

环境。

这些classe将在以后的几个项目中使用。


有没有怎么样?有关如何使用视觉效果的链接

studio?

最好有一个Windows或控制台应用程序开发

并测试每个类,然后将其放入一个库中,或者它是否可以将一个可以包含在测试中的库项目
应用程序,因此仍然可以调试?


感谢提示,链接和帮助。


问候

Rainer Queck
Hi,

What would be the best way to develop a class library?
I am planing to develop a couple of classes, needed in our company
enviroment.
These classe will be later used in several projects.

Are there any "how to" links available on how to do that with visual
studio?
Would it be best to have a "Windows" or "Console" application to develop
and test each class and then put it into a library later on or is it
possible to have a Library project that can be included into a test
application and thereby still be debuggable?

Thanks for hint, links and help.

Regards
Rainer Queck



嗨Peter,


感谢您的帮助和提示。


Rainer


" Peter Bradley" < pb ****** @ uwic.ac.ukschrieb im Newsbeitrag

news:%2 **************** @ TK2MSFTNGP05.phx。 gbl ...
Hi Peter,

thanks for you help and tips.

Rainer

"Peter Bradley" <pb******@uwic.ac.ukschrieb im Newsbeitrag
news:%2****************@TK2MSFTNGP05.phx.gbl...

当你启动新的

解决方案时,只需在VS中选择类库项目类型。


要测试它,您需要将Windows.Forms或Console项目添加到您可以构建为类库的客户端的

解决方案中。制作

解决方案的启动项目。无论你使用Windows.Forms

项目还是一个Console项目都没有什么区别,只要它可以运行你库中所有类的所有方法,

根据您的测试计划。它仅用于测试目的。所以对你来说就是这么多了:无论你最开心的是什么。


你有测试计划,不是吗? :0)


确保库中的所有类都在同一个命名空间中:并且

明智地选择你的命名空间。这可能比同一个程序集中的所有类都更重要。我会确保组成库(命名空间)的所有程序集都已签名,这样就可以将它们部署到GAC中。这将有助于您进行版本控制。


当然,您可以随时执行相反的操作,并使用测试可执行文件启动您的

解决方案,然后再包含另一个项目为

您的图书馆(右键点击解决方案-Add -new项目,然后

选择类库)。正如Perl家伙所说,TMTOWTDI。结局

结果将完全相同。


HTH


彼得


Rainer Queck < Ra **** @ noemail.noemailwrote in message

news:eA ************** @ TK2MSFTNGP05.phx.gbl ...
Just select the Class Library project type in VS when you start your new
solution.

To test it you''ll want to add a Windows.Forms or Console project to your
solution that you can build as a client for your class library. Make it
the startup project for your solution. Whether you use a Windows.Forms
project or a Console project makes absolutely no difference, as long as it
exercises all the methods of all the classes in your library, in
accordance with your test plan. It''s only for test purposes. So it''s up
to you: whatever you feel happiest with.

You do have a test plan, don''t you? :0)

Make sure all your classes in your library are in the same namespace: and
pick your namespace wisely. This is probably more important than having
all the classes in the same assembly. I''d make sure all the assemblies
that make up the library (namespace) were signed, so that they can be
deployed to the GAC. This will help you with versioning.

Of course you could always do things the other way around and start your
solution with the test executable and then include another project for
your library (right click on the solution -Add -new project, and then
select "Class library"). As the Perl guys say, "TMTOWTDI". The end
result will be exactly the same.

HTH
Peter
"Rainer Queck" <Ra****@noemail.noemailwrote in message
news:eA**************@TK2MSFTNGP05.phx.gbl...

>

开发类库的最佳方法是什么?
我计划开发几个类,我们公司所需要的
环境。
这些classe将在以后的几个项目中使用。

是否有任何如何有关如何使用visual
studio的链接?
最好是有一个Windows吗?或控制台应用程序开发
并测试每个类,然后将其放入库中,或者是否可以将库项目包含在测试应用程序中,从而仍然可以调试?

感谢提示,链接和帮助。

问候
Rainer Queck
>Hi,

What would be the best way to develop a class library?
I am planing to develop a couple of classes, needed in our company
enviroment.
These classe will be later used in several projects.

Are there any "how to" links available on how to do that with visual
studio?
Would it be best to have a "Windows" or "Console" application to develop
and test each class and then put it into a library later on or is it
possible to have a Library project that can be included into a test
application and thereby still be debuggable?

Thanks for hint, links and help.

Regards
Rainer Queck




类是膨胀软件,它们增加了复杂性,冗长和慢速代码

执行


我已经有十几本书说这是事实



2月15日晚上11点45分,Rainer Queck < Rai ... @ noemail.noemailwrote:
classes are bloatware, they add complexity, verbosity and slow code
execution

I''ve got a dozen books that state this as fact


On Feb 15, 11:45 pm, "Rainer Queck" <Rai...@noemail.noemailwrote:




开发一个最好的方法是什么?班级图书馆?

我计划在我们公司开发几门课程

环境。

这些classe将在以后用于几个项目。


有没有如何有关如何使用visual studio的链接?

最好是有一个Windows吗?或控制台应用程序开发和/ b $ b测试每个类,然后将其放入库中,或者是否有可能使用b $ b来创建一个可以包含在测试应用程序中的库项目

因此仍然可以调试吗?


感谢提示,链接和帮助。


问候

Rainer Queck
Hi,

What would be the best way to develop a class library?
I am planing to develop a couple of classes, needed in our company
enviroment.
These classe will be later used in several projects.

Are there any "how to" links available on how to do that with visual studio?
Would it be best to have a "Windows" or "Console" application to develop and
test each class and then put it into a library later on or is it possible to
have a Library project that can be included into a test application and
thereby still be debuggable?

Thanks for hint, links and help.

Regards
Rainer Queck



这篇关于如何开发类库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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