简体   繁体   English

在 Visual Studio C# 2010 的父目录中添加项目

[英]Adding an item that is in a parent directory in Visual Studio C# 2010

My folder structure is as follows:我的文件夹结构如下:

Folder文件夹
Classes课程
TestClass.cs测试类.cs
PlayerClass播放器类
PlayerClass.csproj PlayerClass.csproj
............ …………

When i go to PlayerClass => Add Existing Item and finds TestClass.cs it copies it to the PlayerClass folder.当我 go 到 PlayerClass => 添加现有项目并找到 TestClass.cs 时,它将其复制到 PlayerClass 文件夹。 When i edit it in my project it saves it to "Folder/PlayerClass/TestClass.cs"当我在我的项目中编辑它时,它会将其保存到“Folder/PlayerClass/TestClass.cs”

But i want it to save to "Folder/Classes/TestClass.cs" And i can't use "../Classes/TestClass.cs" to define the file!但我希望它保存到“Folder/Classes/TestClass.cs”而且我不能使用“../Classes/TestClass.cs”来定义文件!

Any Ideas?有任何想法吗?

Ok, i found out how to do it.好的,我发现了如何做到这一点。 When you select the files there is a button called "Add".当您 select 文件时,有一个名为“添加”的按钮。 You should press on the triangle next to it and press "Add As Link" and it works!您应该按下它旁边的三角形,然后按“添加为链接”,它就可以工作了!

Looks like you found the answer, hopefully the below will help anyone else.看起来您找到了答案,希望以下内容对其他人有所帮助。

http://cf-bill.blogspot.com/2007/10/visual-studio-sharing-one-file-between.html http://cf-bill.blogspot.com/2007/10/visual-studio-sharing-one-file-between.html

Ok, i found out how to do it.好的,我发现了如何做到这一点。 When you select the files there is a button called "Add".当您 select 文件时,有一个名为“添加”的按钮。 You should press on the triangle next to it and press "Add As Link" and it works!您应该按下它旁边的三角形,然后按“添加为链接”,它就可以工作了!

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM