从VS.Net项目中排除文件 [英] Excluding a file from VS.Net Project

查看:233
本文介绍了从VS.Net项目中排除文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




好​​奇心 - 右键单击​​VS.Net解决方案资源管理器中的文件

并选择从项目中排除 ,它继续在解决方案中显示

资源管理器作为一种幽灵般的轮廓(只要你选择了显示

所有文件)。然而,如果你在一个

文本编辑器中打开项目文件(只是XML),对现在排除的文件的引用已经消失了。


问题:VS.Net如何能够在解决方案资源管理器中显示该文件

当所有对它的引用都已从项目文件中删除时?


TIA ,


JON

Hi,

Curiosity - when you right-click on a file in the VS.Net Solution Explorer
and select "Exclude from Project", it continues to be shown in the Solution
Explorer as a sort of ghostly outline (as long as you have selected "Show
All Files"). Yet if you open up the project file (which is just XML) in a
text editor, the reference to the now-excluded file has gone.

Question: how is VS.Net still able to show the file in Solution Explorer
when all references to it have been deleted from the project file?

TIA,

JON

推荐答案

Jon Maz写道:
Jon Maz wrote:
好奇心 - 当您右键单击VS.Net解决方案资源管理器中的文件
并选择从项目中排除时,它将继续在解决方案资源管理器中显示为一种幽灵般的轮廓(只要您选择了显示所有文件)。然而,如果你在
文本编辑器中打开项目文件(只是XML),对现在排除的文件的引用已经消失。

问题:VS.Net如何仍然能否在解决方案资源管理器中显示文件
何时从项目文件中删除了对它的所有引用?
Curiosity - when you right-click on a file in the VS.Net Solution Explorer
and select "Exclude from Project", it continues to be shown in the Solution
Explorer as a sort of ghostly outline (as long as you have selected "Show
All Files"). Yet if you open up the project file (which is just XML) in a
text editor, the reference to the now-excluded file has gone.

Question: how is VS.Net still able to show the file in Solution Explorer
when all references to it have been deleted from the project file?




Jon,我不知道确定,但我想当你选择显示所有文件时,它会在相应的目录中显示* all *文件

。给那些没有包含在项目中的幽灵大纲提供



这就是它仍然知道它的存在 - 它是一个文件目录。


也就是说,从项目中排除一个文件并没有将它从文件中删除

系统,它只是将它与项目无关联。


hth

-


Scott Mitchell
mi ****** @ 4guysfromrolla.com
http://www.4GuysFromRolla.com


*当你想到ASP.NET时,请考虑4GuysFromRolla.com! br />



Jon, I don''t know for certain, but I imagine it just shows *all* files
in the appropriate directory when you select to "Show All Files," giving
the ghostly outline to those that are not included in the project.
That''s how it still knows it''s there - it''s a file in the directory.

That is, excluding a file from a project doesn''t delete it from the file
system, it just unassociates it with the project.

hth

--

Scott Mitchell
mi******@4guysfromrolla.com
http://www.4GuysFromRolla.com

* When you think ASP.NET, think 4GuysFromRolla.com!


嗨斯科特,


合理,但我认为这个谜仍在继续......


试试这个:


1创建一个项目

2显示所有文件

3添加一个新文件temp。 TXT"通过项目根文件夹中的解决方案资源管理器

4排除" temp.txt"来自项目

5关闭项目,保存所有内容

6导航到根文件夹并删除temp.txt通过Windows资源管理器

7再次打开项目

8文件temp.txt是*仍然*在解决方案资源管理器中,所有幽灵和

malevolent。


!!!!!!! ????????? ?? !!!!!!!!!!!!

JON

Hi Scott,

Plausible, but I think the mystery continues...

Try this:

1 Create a project
2 Show All Files
3 Add a new file "temp.txt" via Solution Explorer in the project root folder
4 Exclude "temp.txt" from the project
5 Close the project down, saving everything
6 Navigate to the root folder and delete "temp.txt" via windows explorer
7 Open the project again
8 The file "temp.txt" is *still* there in Solution Explorer, all ghostly and
malevolent.

!!!!!!!???????????!!!!!!!!!!!!

JON


我不能责备。我尝试了你所说的,但是在第7步中,当我再次打开解决方案并点击显示ALl文件时, test.txt不存在。

我正在使用VS.NET 2003.


Jon Maz写道:
I am not able to repro. I tried what you said, but in Step 7, when I
reopen the Solution and click "Show ALl Files," test.txt is not there.
I am using VS.NET 2003.

Jon Maz wrote:
嗨斯科特,

似是而非,但我认为这个谜仍在继续......

试试这个:

1创建一个项目
2显示所有文件
3添加一个新文件temp.txt通过项目根文件夹中的解决方案资源管理器
4排除temp.txt来自项目
5关闭项目,保存所有内容
6导航到根文件夹并删除temp.txt。通过Windows资源管理器
7再次打开项目
8文件temp.txt是*仍然*在解决方案资源管理器中,所有幽灵和恶意。

!!!!!!! ??????????? !!!!!! !!!!!!

JON
Hi Scott,

Plausible, but I think the mystery continues...

Try this:

1 Create a project
2 Show All Files
3 Add a new file "temp.txt" via Solution Explorer in the project root folder
4 Exclude "temp.txt" from the project
5 Close the project down, saving everything
6 Navigate to the root folder and delete "temp.txt" via windows explorer
7 Open the project again
8 The file "temp.txt" is *still* there in Solution Explorer, all ghostly and
malevolent.

!!!!!!!???????????!!!!!!!!!!!!

JON



-


Scott Mitchell mi******@4guysfromrolla.com
http://www.4GuysFromRolla.com


*当你想到ASP.NET时,请想一想4GuysFromRolla.com!


--

Scott Mitchell
mi******@4guysfromrolla.com
http://www.4GuysFromRolla.com

* When you think ASP.NET, think 4GuysFromRolla.com!


这篇关于从VS.Net项目中排除文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆