473,473 Members | 1,492 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Excluding a file from VS.Net Project

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

Jul 21 '05 #1
10 1525
Jon Maz wrote:
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, 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!
Jul 21 '05 #2
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

Jul 21 '05 #3
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:
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

* When you think ASP.NET, think 4GuysFromRolla.com!
Jul 21 '05 #4
Jon, you have too much time on your hands...

--
:-),
Kevin Spencer
..Net Developer
Microsoft MVP
Neither a follower
nor a lender be.

"Jon Maz" <jo****@surfeuNOSPAM.de> wrote in message
news:em**************@TK2MSFTNGP09.phx.gbl...
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

Jul 21 '05 #5
> 8 The file "temp.txt" is *still* there in Solution Explorer, all ghostly
and
malevolent.

I've done this with my messing around with adding files to the project. I
had several nested directories I wanted to make part of the project. So I
added them like I would do in JBuilder and then refreshed the proj but there
weren't added. :< I could drag'n'drop them into VS, but it would only
recreate the folders, not add the underneath files. :< Kind of makes me
wonder the value of the refresh button?
Jul 21 '05 #6
Hi All,

SCOTT
1 Am using VS2002
2 Genius! When I reach the puzzling Step 8, if I click "Show All Files"
*twice*, the offending file has disappeared as it should! All is now right
in the world, and we are at the cusp of a new dawn of peace and happiness.

KEVIN
1 Why do people keep saying that to me?
2 Amazingly, there is a bit more to all this than idle hands... I'm
following up on a suggestion made to me in another thread "Auto-add files &
folders to VS.Net project?"
http://groups.google.com/groups?hl=e...6btnG%3DSearch

FLIP
1 Yup, that's exactly the issue I'm working on (see other thread)

Thanks for all the interest!

JON

Jul 21 '05 #7
Hi Jon,
1 Why do people keep saying that to me?
I hope you realize my remark was in jest. I try to inject a bit of humor
here and there to keep things from getting too dry.
2 Amazingly, there is a bit more to all this than idle hands... I'm
following up on a suggestion made to me in another thread "Auto-add files & folders to VS.Net project?"
After reading your other question, and the answers you got, I understand
your predicament, and I can tell you that there is a good reason that VS.Net
doesn't automatically add files and folders to an given project. That is,
you may not want them added. For example, if you use Visual SourceSafe to
protect your projects, it adds files to your folders that you definitely do
NOT want in your project. Also, at times I have found it convenient to
temporarily exclude a file from a project when compiling, for one reason or
another. If VS.Net automatically added files and folders to projects, you
would soon see a spate of messages coming from people like myself, who would
complain about it not working the way it does now. It's a no-win situation.
Your best bet is to learn to work with the app as it is. And it looks like
you have a solution that works for you now. So, bask away!

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Neither a follower
nor a lender be.

"Jon Maz" <jo****@surfeuNOSPAM.de> wrote in message
news:uE**************@TK2MSFTNGP15.phx.gbl... Hi All,

SCOTT
1 Am using VS2002
2 Genius! When I reach the puzzling Step 8, if I click "Show All Files"
*twice*, the offending file has disappeared as it should! All is now right in the world, and we are at the cusp of a new dawn of peace and happiness.

KEVIN
1 Why do people keep saying that to me?
2 Amazingly, there is a bit more to all this than idle hands... I'm
following up on a suggestion made to me in another thread "Auto-add files & folders to VS.Net project?"
http://groups.google.com/groups?hl=e...wever%252C%2By
ou%2Bcould%2Bvery%2Beasily%2Bwrite%2Ba%2Blittle%2B routine%2Bto%2Bdo%2Bthis%2
6btnG%3DSearch
FLIP
1 Yup, that's exactly the issue I'm working on (see other thread)

Thanks for all the interest!

JON

Jul 21 '05 #8
Hi Kevin,

1 Quite right too - there's nothing like a bit of jocularity when you're
getting down and dirty with XML, which can indeed be as dry as a ...*
2 Good point, hadn't thought of it that way. And anyway I'm learning quite a
lot making this mini-app.

Cheers,

JON

PS Am quite amused that a relatively frivolous question got an immediate
response from several dotnet heavyweights. In future I will avoid all
serious topics, safe in the knowledge that the gurus are on their way.

*see http://www.jamesnaylor.com/extras/slang.html for ways to finish that
sentence


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.797 / Virus Database: 541 - Release Date: 15/11/2004
Jul 21 '05 #9
Jon,

As another step in the experiment, open the .csproj (or .vbproj) file in
your solution with a text editor.

--
Klaus H. Probst, MVP
http://www.vbbox.com/
"Jon Maz" <jo****@surfeuNOSPAM.de> wrote in message
news:e#**************@tk2msftngp13.phx.gbl...
Hi Kevin,

1 Quite right too - there's nothing like a bit of jocularity when you're
getting down and dirty with XML, which can indeed be as dry as a ...*
2 Good point, hadn't thought of it that way. And anyway I'm learning quite a lot making this mini-app.

Cheers,

JON

Jul 21 '05 #10
Hi Klaus,

Yup, playing with the xml in those files is exactly what I'm doing.

Cheers,

JON
Jul 21 '05 #11

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Eric Weiss | last post by:
I have an XML document that I want to use to create two HTML versions: one detailed and one a summary. The detailed output is straight forward to create, but the summary output that excludes the...
10
by: Jon Maz | last post by:
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...
4
by: Mark Rae | last post by:
Hi, Am currently in the process of migrating a whole heap of v1.1 ASP.NET solutions to v2.0, and would be interested to know what others are doing about excluding files from projects. I...
1
by: Norman Crandall | last post by:
I have a directory with about 20,000 other directories and files in it. I need it in the root directory of the web application in order to write to it. However, when I need to build the...
2
by: anon2005 | last post by:
Hi all, OK, I get the whole new compilation model in ASP.NET 2.0. I can see how it's better in team environments and overall, not requiring a project file is useful. The big snags I'm...
1
by: Brett Romero | last post by:
Is there a way to have a file delete from Visual Source Safe if I exclude (not delete) it from a Visual Studio project? I'd like what ever is in the project to be reflected in VSS. I'm using...
2
by: =?Utf-8?B?QnJpYW4gQ29yY29yYW4=?= | last post by:
I want to exclude /MP for one file (precompiled header .cpp file) but don't see a way to do that. I want to avoid the annoying D9030 warning. Any ideas on how to do this? /MP is inherited from...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.