我有两个项目的解决方案.项目之一是带有DLL文件的库.我希望能够在其他项目中引用该项目库以使用其类.我的最终目标是做到这一点,同时仍然可以访问库的源代码.我尝试引用.dll,也尝试引用.csproj.两种情况都可以,但是我收到代码CS0436的120条警告:
I have a Solution with two projects. One of the projects is a library with a DLL file. I want to be able to reference this project library in the other project to use its classes. My end goal is to do this, while still having access to the libraries source code. I've tried referencing the .dll, I've also tried referencing the .csproj. Both cases work but I get 120 warnings for code CS0436:
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指南和其他文章.因此,如果没有人将其标记为重复线程,我将不胜感激.
I've spent over an hour reading MSDN guides and other posts on this site. Because of this, I would greatly appreciate if no one labels this as a duplicate thread.
推荐答案您只需要右键单击项目,然后选择添加"->引用".在此窗口中,从左侧标签中选择项目,然后选择具有dll输出的项目.
You only need to right click on your project and choose Add -> Reference.. In this window choose projects from the left tab and select your project with dll output.
还请确保您的项目具有与其目标相同的.Net框架.
Also be sure your projects has the same .Net framework as their targets.
祝你好运
更多推荐
在Visual Studio中的相同解决方案中引用项目
发布评论