簡體   English   中英

在Visual Studio中的相同解決方案中引用項目

[英]Referencing a Project in the Same Solution in Visual Studio

我有兩個項目的解決方案。 這些項目之一是帶有DLL文件的庫。 我希望能夠在其他項目中引用該項目庫以使用其類。 我的最終目標是做到這一點,同時仍然可以訪問庫的源代碼。 我嘗試引用.dll,也嘗試引用.csproj。 兩種情況都可以,但是代碼CS0436會顯示120條警告:

Warning CS0436  The type 'BitField' in 'C:\FilePath' conflicts with the imported type
'Typename' in 'LibraryName, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. 
Using the type defined in 'C:\FilePath'.    LibraryName C:\FilePath 38  Active

我已經花了一個多小時閱讀本網站上的MSDN指南和其他文章。 因此,如果沒有人將其標記為重復線程,我將不勝感激。

您只需要右鍵單擊項目,然后選擇“添加”->“引用”。在此窗口中,從左側選項卡中選擇項目,然后選擇帶有dll輸出的項目。

另外,請確保您的項目具有與目標相同的.Net框架。

祝好運

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM