How to solve the problem "A project with an Output Type of Class Library cannot be started directly ...

博客介绍了在.NET项目中添加dll的操作步骤。先在.NET Framework Components标签中找到项目文件夹,选择bin→Debug→HelloWorld.dll添加。将组件拖入表单,保存并构建项目,启动项目后点击按钮可显示“Hello World”,还指出可创建自己的dll并在其他项目调用。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

https://www.mainfunction.com/DotNetInAction/Technologies/display.aspx?ID=2402&TypeID=7

Figure 5

Choose the tab labeled .NET Framework Components and click Browse… Find the folder for your HelloWorld project. Then choose bin → Debug → HelloWorld.dll.

Your dll should now be added in the list of .NET Framework Components as UserControl1. Click the check box and then click OK.

Scroll down to the bottom of your Toolbox, and you will see the component UserControl1. Select this component and drag it into your form.

image6.JPG
Figure 6

Now save and build your project. From the menu bar, choose Build → Build. Now start your project by choosing Debug → Start. Your application should appear as shown in Figure 7 below.

image7.JPG
Figure 7

Click the Click Me button and the text “Hello World” appears. Great, huh? Well, maybe not that great, but it’s a start. So now you can create your own dlls and call them from other projects.

转载于:https://www.cnblogs.com/cy163/archive/2005/11/22/281704.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值