如何为ASP.net网站项目中的某些类创建DLL [英] How to create a DLL for some classes in an ASP.net website project

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

问题描述

您好,先生,
我的网站项目中有三个类,分别为class1.cs,class2.cs和class3.cs.
这三个类在同一个命名空间中声明,现在我想为这些类创建一个DLL.
那只是一个DLL.
我该如何创建?
有人可以告诉我吗?

谢谢!

Hello Sir,
I have three classes in my website project named class1.cs, class2.cs and class3.cs.
These three classes are declared in the same namespace and now I want to create a DLL for these classes.
That is one DLL only.
How can I create that?
Can anybody please tell me?

Thank you!

推荐答案

您将不得不在解决方案中创建另一个项目.输出类型必须选择为类库".为了在ASP.NET项目中使用它,您需要从ASP.NET项目中引用您的类库.

还有问题吗?随时给我留言.

干杯!
You''ll have to create an additional project in your solution. The output type must be selected as "Class library". In order to use that in your ASP.NET project you''ll need to reference your class library from the ASP.NET project.

Still have a question? Feel free to leave me a comment.

Cheers!


我最近回答了一个类似的问题.您将在这里找到许多有用的详细信息:
I recently answered a similar Question. You will find many useful details here: How can I create a DLL from my project in C# in VS2010[^].

—SA


要创建程序集,您将需要创建一个项目类库项目.在此项目中,您将创建reportclass.cs类文件.构建此文件时,它将生成DLL文件.不幸的是,您无法在这种类型的项目中创建网页.
To create an assembly you will need to create a project class library project. In this project you will create your reportclass.cs class file. When you build this it will produce the DLL file. Unfortuantely you cannot create web pages in this type of project.


这篇关于如何为ASP.net网站项目中的某些类创建DLL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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