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

Default Project References

P: n/a
If there is a different newsgroup for specific Visual Studio questions then
please let me know - in the meantime perhaps I can post the question here:

It seems that whenever I create new projects, I repeatedly have to add the
same set of References in Solution Explorer. Is there a way of specifying a
default Reference list which will be picked up by all new Projects as a
starting point?

Cheers
Simon
Nov 15 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Simon,

I don't believe that there is a way to do this. However, I do believe
that you can create your own project types, which you would then specify the
project references that you have to set.

Also, for specific projects, you can modify the references that are
added. I don't know how supported this is, but it should work.

If you look in the directory where VS.NET is installed, you should see
the following directory structure:

<Visual Studio .NET directory>
VC#
VC#Wizards
CSharpAddWinFormWiz
Scripts
1033

1033 I believe is the culture code, and it might be different if you
don't have the US english version installed. In that directory is a file
called "default.js". This is a bit of JavaScript that is run when the
project is created. If you open that up, you should notice a line:

AddReferencesForWinForm(selProj);

This is where the references are added. The code for this method is in
the following directory:

<Visual Studio .NET directory>\VC#\VC#Wizards\1033

Once again, 1033 might be different. Find the "common.js" file. In it,
you should be able to find the function AddReferencesForWinForm. That
function looks like this:

function AddReferencesForWinForm(oProj)
{
var refmanager = GetCSharpReferenceManager(oProj);
refmanager.Add("System");
refmanager.Add("System.Data");
refmanager.Add("System.Drawing");
refmanager.Add("System.Windows.Forms");
refmanager.Add("System.XML");
CollapseReferencesNode(oProj);
}

You should be able to add calls (or remove them if you wish) to the Add
method and add your own references.

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

"Simon" <si****@shalex.co.uk> wrote in message
news:40***********************@mercury.nildram.net ...
If there is a different newsgroup for specific Visual Studio questions then please let me know - in the meantime perhaps I can post the question here:

It seems that whenever I create new projects, I repeatedly have to add the
same set of References in Solution Explorer. Is there a way of specifying a default Reference list which will be picked up by all new Projects as a
starting point?

Cheers
Simon

Nov 15 '05 #2

P: n/a
Nicholas

The "back-door" approach worked well. I wouldn't have worked that one out
though! Shame that there wasn't a more straight-forward approach. I guess
that while I would consider the ability to do this a "must-have", the
requirement is actually more niche in the real world. Oh well, my mind must
work differently to others!

Do you have any more information on creating custom project types?

Many thanks for your help.
Cheers
Simon

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in
message news:%2****************@TK2MSFTNGP11.phx.gbl...
Simon,

I don't believe that there is a way to do this. However, I do believe
that you can create your own project types, which you would then specify the project references that you have to set.

Also, for specific projects, you can modify the references that are
added. I don't know how supported this is, but it should work.

If you look in the directory where VS.NET is installed, you should see
the following directory structure:

<Visual Studio .NET directory>
VC#
VC#Wizards
CSharpAddWinFormWiz
Scripts
1033

1033 I believe is the culture code, and it might be different if you
don't have the US english version installed. In that directory is a file
called "default.js". This is a bit of JavaScript that is run when the
project is created. If you open that up, you should notice a line:

AddReferencesForWinForm(selProj);

This is where the references are added. The code for this method is in the following directory:

<Visual Studio .NET directory>\VC#\VC#Wizards\1033

Once again, 1033 might be different. Find the "common.js" file. In it, you should be able to find the function AddReferencesForWinForm. That
function looks like this:

function AddReferencesForWinForm(oProj)
{
var refmanager = GetCSharpReferenceManager(oProj);
refmanager.Add("System");
refmanager.Add("System.Data");
refmanager.Add("System.Drawing");
refmanager.Add("System.Windows.Forms");
refmanager.Add("System.XML");
CollapseReferencesNode(oProj);
}

You should be able to add calls (or remove them if you wish) to the Add method and add your own references.

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

"Simon" <si****@shalex.co.uk> wrote in message
news:40***********************@mercury.nildram.net ...
If there is a different newsgroup for specific Visual Studio questions then
please let me know - in the meantime perhaps I can post the question here:
It seems that whenever I create new projects, I repeatedly have to add the same set of References in Solution Explorer. Is there a way of

specifying a
default Reference list which will be picked up by all new Projects as a
starting point?

Cheers
Simon


Nov 15 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.