简体   繁体   English

如何在Visual Studio 2010中引用C#类库项目?

[英]How to reference a C# Class Library project in Visual Studio 2010?

I am new to visual studio and was wondering how to setup visual studio 2010 so that I can reference my C# windows class library project? 我是视觉工作室的新手,想知道如何设置visual studio 2010,以便我可以参考我的C#windows类库项目? I currently have a solution with 2 projects - C# library project and a unit test project. 我目前有一个包含2个项目的解决方案 - C#库项目和单元测试项目。

What is the best way to create multiple clients that will use this library? 创建将使用此库的多个客户端的最佳方法是什么? Should they be their own solution or just another project in the library solution? 它们应该是自己的解决方案还是库解决方案中的另一个项目? How do I use the classes in the library function from the project that references the library project? 如何在引用库项目的项目中使用库函数中的类?

You can add a reference to a library by doing a rightclick on the references node in the solution explorer and selecting the req. 您可以通过右键单击解决方案资源管理器中的引用节点并选择req来添加对库的引用。 lib... LIB ...

When all you consuming apps are located within the same solution I would prefer to place the lib also inside the sln, otherwise I would use an extra sln 当你所有消费的应用程序都位于同一个解决方案中时,我宁愿将lib也放在sln中,否则我会使用额外的sln

Right click on the Client project "References" - > Add Reference Go to the Projects tab if the class library is in the same solution. 右键单击客户端项目“引用” - >添加引用如果类库位于同一解决方案中,请转到“项目”选项卡。 Else Browse and select the dll of the class library. 否则浏览并选择类库的DLL。

If Class library is not going to release as common dll for multiple projects, it's better to add them all to the same solution. 如果类库不会作为多个项目的公共dll发布,那么最好将它们全部添加到同一个解决方案中。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Visual Studio 2010:如何引用具有第三方依赖性的C#.Net类库项目 - Visual Studio 2010: How refer to a C# .Net class library project with third part dependencies 如何在内部使用IronPython引用自包含的C#类库项目(Visual Studio 2010) - How to refer self-contained C# class library project with IronPython inside (Visual Studio 2010) 我可以在Visual Studio 2010(C#)中引用引用的库吗 - Can I reference a referenced library in Visual Studio 2010 (C#) Visual Studio C# 我可以使用哪个 Class 库项目引用 Blazor 项目 - Visual Studio C# with which Class Library Projects can I reference a Blazor Project 如何在C#中制作可视的可重用类?(Visual Studio 2010) - How to make a visual reuasable class in C#?(Visual Studio 2010) 如何在Visual Studio 2010中引用辅助项目 - How to reference a secondary project in Visual Studio 2010 将通用Windows C#类库引用添加到通用Windows C ++ DLL项目Visual Studio 2015 - Adding a Universal Windows C# Class Library reference to a Universal Windows C++ DLL project Visual Studio 2015 如何将现有的C#项目导入可移植类库,并使用它引用Visual Studio中的android应用? - How to import your existing C# project into a portable class library and use it to reference to android app in visual studios? 在构建时自动将C ++库复制到C#项目吗? (Visual Studio 2010) - Copy C++ library to a C# project automatically on build? (Visual Studio 2010) 如何在Visual Studio 2008中将程序集清单添加到C#.NET类库项目? - How to add assembly manifest to a C# .NET class library project in Visual Studio 2008?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM