![](/img/trans.png)
[英]How can I use my Web Api project from other projects inside my solution?
[英]I have a solution with two projects how can i use methods from the library type project in the winforms project?
第一個項目是類庫。 我不能只運行它,所以我添加了一個winforms項目,以便可以使用Library方法和類,從而可以調試Library項目。
但是我無法從Winforms進入Lubrary項目。 在winforms中:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void timer1_Tick(object sender, EventArgs e)
{
}
}
}
Library項目的名稱是AviFile,並且其中包含類。
當我輸入計時器滴答聲事件AviFile時,它不存在。
您需要通過右鍵單擊“ Reference
->“添加引用”->“選擇項目”->選擇dll,然后選擇“確定”,在AviFile
項目中添加對名為AviFile
類庫項目的引用。
然后在您的Form類中導入using AviFile;
的名稱空間using AviFile;
有關如何執行此操作,請參閱MSDN文檔 。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.