在C#.Net中创建一个.dll文件

在C#.Net中创建一个.dll文件

问题描述:

我创建了一个项目,该项目是C#控制台应用程序项目,需要在另一个Windows应用程序项目中为此项目dll调用该项目。我已经在Visual Studio 2010中构建了该项目,并在bin\debug文件夹中检查了 .dll 文件,但未创建。

I had created a project which is C# console application project for which I need to call this project dll in another windows application project. I had built the project in visual studio 2010 and checked for .dll file in bin\debug folder, but it is not created.

但是已经创建了清单文件和 .exe 文件。请在这种情况下帮我创建 .dll

But a manifest file and .exe file havebeen created. Please help me out how to create the .dll in this case.

您需要创建一个类库,而不是控制台应用程序。控制台应用程序将转换为 .exe ,然后将类库编译为 dll 在您的Windows项目中。

You need to make a class library and not a Console Application. The console application is translated into an .exe whereas the class library will then be compiled into a dll which you can reference in your windows project.


  • 右键单击控制台应用程序->属性->将输出类型更改为类库