如何在类文件中创建.DLL文件 [英] How to create .DLL file in class file

查看:80
本文介绍了如何在类文件中创建.DLL文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是c#的新手,请帮助我...

i am new in c# please help me......

推荐答案

请参见

没有这种方法东西作为类"文件.有课程,有文件.一个文件可以包含多个类型声明,并且类型声明可以是 partial ,因此它可以分布在多个文件之间.

而且,对于.NET,"DLL"的概念微不足道,这仅是由某种文件名模式(扩展名")指示的文件类型".在.NET中,只有程序集和模块,并且一个模块被实现为 PE文件(Portable Executable) .通常,*.EXE用于应用程序,*.DLL用于类库,但是,完全可以通过引用* .EXE来引用* .DLL和* .DLL来使用* .EXE,这是很可能且合法的.可以以它扮演应用程序"角色的方式托管.

这个问题根本没有道理.实际上,您需要打开项目属性,首先标记应用程序",然后从下拉列表输出类型"中选择一个选项.选项之一是类库".如果您打算做其他事情,那么我的意思是:这种其他"是没有意义的.如果你证明我错了,我会感到惊讶.

请通过阅读原始介绍性文档来学习.NET和CLR/CLI的一些基础知识;这将使您能够提出正确的明智问题.希望我的笔记能对您有所帮助.祝你好运,
—SA
There is no such thing as "class" file. There are classes, there are files. A file can contain several type declaration, and a type declaration could be partial, so it could be distributed between several files.

Moreover, for .NET the concept of "DLL" is insignificant, this is no more that a "file type", indicated by some file name pattern ("extension"). In .NET, there are just assemblies and modules, and a module is implemented as a PE file (Portable Executable). Normally, *.EXE is used for applications, and *.DLL for class libraries, however, it''s quite possible and legitimate to use *.EXE by referencing its assembly exactly as if it was *.DLL, and *.DLL could be hosted the way it plays the role of an "application".

The question simply does not make sense. In practice, you need to open the project Properties, first tag "Application" and choose an option from the drop-down list "Output Type". One of the options is "Class Library". If you meant to do something else, my statement would be: this "something else" does not make sense. I will be amazed if you prove me wrong.

Please learn some basics of .NET and CLR/CLI through reading of original introductory documentation; it will make you able to ask correct sensible questions. I hope my notes can help you with that. Good luck,
—SA


这篇关于如何在类文件中创建.DLL文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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