现在的位置: 首页 > 综合 > 正文

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

2012年09月01日 ⁄ 综合 ⁄ 共 759字 ⁄ 字号 评论关闭
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.


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.


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.

抱歉!评论已关闭.