VS2010:在解决方案中使用另一个项目中的名称空间? [英] VS2010: Use namespace from another project within the solution?
问题描述
在Visual Studio 2010的单个解决方案中,我有两个项目.这些项目分别称为Project1和Project2.在这些项目中,分别定义了两个名称空间,分别是Namespace1和Namespace2.
I have two projects within a single solution in Visual Studio 2010. These projects are called Project1 and Project2. Within these projects, two namespaces are defined, Namespace1 and Namespace2, respectively.
在Namespace2中的一些代码中,我想使用在Namespace1中定义的一些结构,类等.有什么办法吗?
Inside some code within Namespace2, I'd like to use some structs, classes, etc. which I've defined in Namespace1. Is there any way to do this?
推荐答案
是的,从Project2添加对Project1的引用.右键单击项目,选择添加引用",然后从项目"选项卡中,选择Project1.
Yes, add a reference to Project1 from Project2. Right-click the project, choose "Add References" then from the "Projects" tab, choose Project1.
这篇关于VS2010:在解决方案中使用另一个项目中的名称空间?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!