By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,424 Members | 1,316 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,424 IT Pros & Developers. It's quick & easy.

Is a custom project hierarchy possible for C# projects?

P: n/a
/FooProject
/bin (release)
/doc
/src (only *.cs)
/temp (obj files)
/test (debug)
/build
/Visual Studio 2003
/Visual Studio 2005

I want the solution and project files in the IDE directories, and I want
those project files to have the source code root directory point to /src
and the object files point to /temp. I cannot figure out how to make
Visual Studio do this. It wants the project files in the same directory
as the source code. I'm using Visual C# Express Beta 1. C++ project
files have <Filter>, which looks like a directory in the solution
explorer, that can point to anywhere on disk. I am aware that one can
link files, but this is not enough. I'll have to create the files outside
of visual studio because "Add New File" won't add it to the right
directory. I need to link folders (don't know how) or set the root
directory to /src like I want to. Why are the Visual Studio Team being
despotic about C# projects?

C++ project file:

<Filter Name="My Foo Files" Filter="h;hpp;hxx;hm;inl">
<File RelativePath="..\..\..\src\Foo.h"></File>
<File RelativePath="..\..\..\src\Foo2.h"></File>
<File RelativePath="..\..\..\src\FooFoo.h"></File>
<File RelativePath="..\..\..\src\Bar.h"></File>

You can also have a filter inside this filter for a subdirectory.
</Filter>

In C++ projects, you can also set the obj folder to wherever you want. It
gives full control over how you want to manage the project.
Please help!

Thank you!
Nov 16 '05 #1
Share this Question
Share on Google+
7 Replies


P: n/a
SpookyET,

Have yout tried starting with a blank project/solution, and then adding
things to that? It's much easier to get the structure you need by doing
that.

Also, I believe you should be able to create directories in your sub
projects like you want, and place your source files in those sub
directories.

As for the obj files, you will have to go into the project file and
modify it yourself to do that. The Express edition should be using the
MSBUILD system in order to compile the project. However, it probably will
require you to go to the master build files on the system (they are in the
..NET install directory) and change those, or replicate the tasks in your
project file.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"SpookyET" <no****@hotmail.com> wrote in message
news:op.sm9up4ns1s9n15@saturn...
/FooProject
/bin (release)
/doc
/src (only *.cs)
/temp (obj files)
/test (debug)
/build
/Visual Studio 2003
/Visual Studio 2005

I want the solution and project files in the IDE directories, and I want
those project files to have the source code root directory point to /src
and the object files point to /temp. I cannot figure out how to make
Visual Studio do this. It wants the project files in the same directory
as the source code. I'm using Visual C# Express Beta 1. C++ project
files have <Filter>, which looks like a directory in the solution
explorer, that can point to anywhere on disk. I am aware that one can
link files, but this is not enough. I'll have to create the files outside
of visual studio because "Add New File" won't add it to the right
directory. I need to link folders (don't know how) or set the root
directory to /src like I want to. Why are the Visual Studio Team being
despotic about C# projects?

C++ project file:

<Filter Name="My Foo Files" Filter="h;hpp;hxx;hm;inl">
<File RelativePath="..\..\..\src\Foo.h"></File>
<File RelativePath="..\..\..\src\Foo2.h"></File>
<File RelativePath="..\..\..\src\FooFoo.h"></File>
<File RelativePath="..\..\..\src\Bar.h"></File>

You can also have a filter inside this filter for a subdirectory.
</Filter>

In C++ projects, you can also set the obj folder to wherever you want. It
gives full control over how you want to manage the project.
Please help!

Thank you!

Nov 16 '05 #2

P: n/a
Mr. Paldino,

Starting with a blank solution does not help. Visual Studio wants source
files coupled with .csproj files. The file hierarchy that I want
decouples the project files from the source code and also have them under
different root directories.
This is how VS wants its directories.
/Foo
/Foo/Foo.csproj
/Foo/Foo.cs
/Foo/Bar/
/Foo/Bar/Bar.cs

Obviously, the hierarchy that I want goes against it. MSBUILD does not
care where your files reside on disk. This is a Visual Studio problem.
Also, the schemas that define the MSBuild tags in the .NET directory do
not define the VS project files. MSBuild allows you to have additional
tags that you define like <AppDesigner> that are useful for other tools,
which it ignores. However, those schemas are missing. The URL for the
..csproj "http://schemas.microsoft.com/developer/msbuild/2003" returns 404.

PS: You don't have to modify the master files to change something. You
can overwrite settings in your project files. It works like CSS.

On Mon, 07 Mar 2005 09:50:14 -0500, Nicholas Paldino [.NET/C# MVP]
<mv*@spam.guard.caspershouse.com> wrote:
SpookyET,

Have yout tried starting with a blank project/solution, and then
adding
things to that? It's much easier to get the structure you need by doing
that.

Also, I believe you should be able to create directories in your sub
projects like you want, and place your source files in those sub
directories.

As for the obj files, you will have to go into the project file and
modify it yourself to do that. The Express edition should be using the
MSBUILD system in order to compile the project. However, it probably
will
require you to go to the master build files on the system (they are in
the
.NET install directory) and change those, or replicate the tasks in your
project file.

Hope this helps.


--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
Nov 16 '05 #3

P: n/a
SpookyET,

I understand what you are saying now, and no, you can not decouple the
source and the project file in this manner. The best you could have is the
project file in a directory that is a parent directory of where the source
is.

Also, the VS.NET build system IS MSBUILD for VS.NET 2005, and for the
Express Editions (I believe, since they are locked down versions of VS.NET
2005).

And yes, project files in VS.NET 2005 (and the Express Editions) are
MSBUILD files.

I wouldn't expect the URL for the schema in the file to work either,
since the namespace definition doesn't have to necessarily point to a valid
resource, it just serves as a unique identifier.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"SpookyET" <no****@hotmail.com> wrote in message
news:op.sm9y9qi11s9n15@saturn...
Mr. Paldino,

Starting with a blank solution does not help. Visual Studio wants source
files coupled with .csproj files. The file hierarchy that I want
decouples the project files from the source code and also have them under
different root directories.
This is how VS wants its directories.
/Foo
/Foo/Foo.csproj
/Foo/Foo.cs
/Foo/Bar/
/Foo/Bar/Bar.cs

Obviously, the hierarchy that I want goes against it. MSBUILD does not
care where your files reside on disk. This is a Visual Studio problem.
Also, the schemas that define the MSBuild tags in the .NET directory do
not define the VS project files. MSBuild allows you to have additional
tags that you define like <AppDesigner> that are useful for other tools,
which it ignores. However, those schemas are missing. The URL for the
.csproj "http://schemas.microsoft.com/developer/msbuild/2003" returns 404.

PS: You don't have to modify the master files to change something. You
can overwrite settings in your project files. It works like CSS.

On Mon, 07 Mar 2005 09:50:14 -0500, Nicholas Paldino [.NET/C# MVP]
<mv*@spam.guard.caspershouse.com> wrote:
SpookyET,

Have yout tried starting with a blank project/solution, and then
adding
things to that? It's much easier to get the structure you need by doing
that.

Also, I believe you should be able to create directories in your sub
projects like you want, and place your source files in those sub
directories.

As for the obj files, you will have to go into the project file and
modify it yourself to do that. The Express edition should be using the
MSBUILD system in order to compile the project. However, it probably
will
require you to go to the master build files on the system (they are in
the
.NET install directory) and change those, or replicate the tasks in your
project file.

Hope this helps.


--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/

Nov 16 '05 #4

P: n/a
I doubt that these settings are hard-coded. They are either in the
registry or in a settings file. I hope that someone has the answer on how
to change them. Adding <IntermediateOutputPath
..\..\temp\</IntermediateOutputPath> changes the obj dir to ../../temp, but Visual Studio still creates /obj.

On Mon, 07 Mar 2005 11:18:19 -0500, Nicholas Paldino [.NET/C# MVP]
<mv*@spam.guard.caspershouse.com> wrote:
SpookyET,

I understand what you are saying now, and no, you can not decouple
the
source and the project file in this manner. The best you could have is
the
project file in a directory that is a parent directory of where the
source
is.

Also, the VS.NET build system IS MSBUILD for VS.NET 2005, and for the
Express Editions (I believe, since they are locked down versions of
VS.NET
2005).

And yes, project files in VS.NET 2005 (and the Express Editions) are
MSBUILD files.

I wouldn't expect the URL for the schema in the file to work either,
since the namespace definition doesn't have to necessarily point to a
valid
resource, it just serves as a unique identifier.


--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
Nov 16 '05 #5

P: n/a
By the way, MSBuild is decoupled from Visual Studio. It comes with the
..NET Framework, so there is no locked down version.

On Mon, 07 Mar 2005 11:18:19 -0500, Nicholas Paldino [.NET/C# MVP]
<mv*@spam.guard.caspershouse.com> wrote:
SpookyET,

I understand what you are saying now, and no, you can not decouple
the
source and the project file in this manner. The best you could have is
the
project file in a directory that is a parent directory of where the
source
is.

Also, the VS.NET build system IS MSBUILD for VS.NET 2005, and for the
Express Editions (I believe, since they are locked down versions of
VS.NET
2005).

And yes, project files in VS.NET 2005 (and the Express Editions) are
MSBUILD files.

I wouldn't expect the URL for the schema in the file to work either,
since the namespace definition doesn't have to necessarily point to a
valid
resource, it just serves as a unique identifier.


--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
Nov 16 '05 #6

P: n/a
Spooky,

Can you elaborate on what it is you are trying to accomplish and why? Maybe
if we knew what your ultimate reason was we might be able to suggest a
possible solution. Are you trying to use use to different dev tools at
once? Maybe what you could do is use a source control tool, then the actual
files are stored in a repository and the dev tool no longer matters.

JIM
"SpookyET" <no****@hotmail.com> wrote in message
news:op.sm91nnnp1s9n15@saturn...
By the way, MSBuild is decoupled from Visual Studio. It comes with the
.NET Framework, so there is no locked down version.

On Mon, 07 Mar 2005 11:18:19 -0500, Nicholas Paldino [.NET/C# MVP]
<mv*@spam.guard.caspershouse.com> wrote:
SpookyET,

I understand what you are saying now, and no, you can not decouple
the
source and the project file in this manner. The best you could have is
the
project file in a directory that is a parent directory of where the
source
is.

Also, the VS.NET build system IS MSBUILD for VS.NET 2005, and for the
Express Editions (I believe, since they are locked down versions of
VS.NET
2005).

And yes, project files in VS.NET 2005 (and the Express Editions) are
MSBUILD files.

I wouldn't expect the URL for the schema in the file to work either,
since the namespace definition doesn't have to necessarily point to a
valid
resource, it just serves as a unique identifier.


--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/

Nov 16 '05 #7

P: n/a
I'm trying to make the project hierarchy more organized that would allow
for easier tagging and branching under Subversion. It would also allow
for many different IDEs to store their project files in a subdir under
/build. I've seen many open source projects having a similar project
hierarchy. For example, VCF (Visual Component Framework), a C++ GUI
library similar to Windows Forms, uses a similar hierarchy. I'm trying to
do the same. As I said earlier, Visual C++ projects do no have this
problem.

On Mon, 07 Mar 2005 12:16:59 -0500, James <no****@hypercon.net> wrote:
Spooky,

Can you elaborate on what it is you are trying to accomplish and why?
Maybe
if we knew what your ultimate reason was we might be able to suggest a
possible solution. Are you trying to use use to different dev tools at
once? Maybe what you could do is use a source control tool, then the
actual
files are stored in a repository and the dev tool no longer matters.

JIM
"SpookyET" <no****@hotmail.com> wrote in message
news:op.sm91nnnp1s9n15@saturn...
By the way, MSBuild is decoupled from Visual Studio. It comes with the
.NET Framework, so there is no locked down version.

On Mon, 07 Mar 2005 11:18:19 -0500, Nicholas Paldino [.NET/C# MVP]
<mv*@spam.guard.caspershouse.com> wrote:
SpookyET,

I understand what you are saying now, and no, you can not decouple
the
source and the project file in this manner. The best you could have is
the
project file in a directory that is a parent directory of where the
source
is.

Also, the VS.NET build system IS MSBUILD for VS.NET 2005, and for
the
Express Editions (I believe, since they are locked down versions of
VS.NET
2005).

And yes, project files in VS.NET 2005 (and the Express Editions)
are
MSBUILD files.

I wouldn't expect the URL for the schema in the file to work
either,
since the namespace definition doesn't have to necessarily point to a
valid
resource, it just serves as a unique identifier.


--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/



--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
Nov 16 '05 #8

This discussion thread is closed

Replies have been disabled for this discussion.