[英]VS 2010 Visual C# - reference other project in same solution
I'm having a problem with a VS2010 solution. 我遇到了VS2010解决方案的问题。 I have two projects in the solution, one is the main program, while the other is a program used for editing data/setting up files for the second. 我在解决方案中有两个项目,一个是主程序,另一个是用于编辑数据/为第二个设置文件的程序。 In order to make my second project work, I need to be able to access the classes/enums/etc. 为了使我的第二个项目工作,我需要能够访问类/枚举/等。 inside the first. 在第一个里面。
I know with VS2010 you can add a project as a reference inside another project. 我知道VS2010你可以在另一个项目中添加一个项目作为参考。 I tried doing that, and it seemed to work. 我试过这样做,似乎有效。 I can add the namespaces, and use the enums, but as soon as I try and compile the 2nd project, it's as though it looses the references, and it returns errors for all the classes/enums i used from the main project. 我可以添加命名空间,并使用枚举,但是一旦我尝试编译第二个项目,就好像它丢失了引用,并且它返回了我在主项目中使用的所有类/枚举的错误。 If I delete the reference, and readd it, I can again use all the stuff in the first project, but again compiling destroys the references. 如果我删除引用并读取它,我可以再次使用第一个项目中的所有内容,但再次编译会破坏引用。
I've tried rebuilding the first project, tried changing the output type, etc. but to no avail. 我已经尝试重建第一个项目,尝试更改输出类型等,但无济于事。 Does anyone have an idea what might be wrong? 有谁知道什么可能是错的?
For reference, this is on Windows 7 64, using Visual Studio 2010 Ultimate, and both are C# 4.0 projects. 作为参考,这是在Windows 7 64上,使用Visual Studio 2010 Ultimate,两者都是C#4.0项目。 I'm using System.Data.SQLite/System.Data.SQLite.Linq, but removing them didnt make it work. 我正在使用System.Data.SQLite / System.Data.SQLite.Linq,但删除它们并没有使它工作。
Thanks in advance 提前致谢
Make sure they both are referencing the same .Net 4 Profile , one may be using the client profile 确保它们都引用相同的.Net 4配置文件 ,其中一个可能正在使用客户端配置文件
http://msdn.microsoft.com/en-us/library/cc656912.aspx http://msdn.microsoft.com/en-us/library/cc656912.aspx
They should both be .NET 4
or both be .NET 4 Client Profile
它们应该是.NET 4
或两者都是.NET 4 Client Profile
确保在编译(调试)时,您的solution platform
设置为“任何CPU”
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.