Changing project references programmatically

C

chris fellows

Can someone tell me if .NET 2.0 framework has a namespace to enable project
references to be changed programmatically? My C# project files are stored in
source control with DLL references but I want to be create a utility that
changes the DLL references to project references in the project file. This
is so that all of the projects can be run in debug but without having to
manually change the references each time.

Obviously I can use the Xml namespace but I was wondering if there's an
easier way.
 
R

Robbe Morris - [MVP] C#

Why do you store them in source control with DLL references
instead of project references?
 
C

chris fellows

Because it is the best solution in our particular circumstances. I'm fully
aware of the pros and cons of both solutions.

Robbe Morris - [MVP] C# said:
Why do you store them in source control with DLL references
instead of project references?

--
Robbe Morris [Microsoft MVP - Visual C#]
AdvancedXL Server, Designer, and Data Analyzer
Convert cell ranges in Excel to rule driven web surveys
http://www.equalssolved.com/default.aspx




chris fellows said:
Can someone tell me if .NET 2.0 framework has a namespace to enable
project references to be changed programmatically? My C# project files
are stored in source control with DLL references but I want to be create
a utility that changes the DLL references to project references in the
project file. This is so that all of the projects can be run in debug but
without having to manually change the references each time.

Obviously I can use the Xml namespace but I was wondering if there's an
easier way.
 
M

Michael Nemtsev [MVP]

Hello chris,

I've seen several time the structure of .cproj file, check codeproject.com
site

having this structure u can easily load this file and change references using
xpath for example

---
WBR,
Michael Nemtsev [.NET/C# MVP] :: blog: http://spaces.live.com/laflour

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo


cf> Can someone tell me if .NET 2.0 framework has a namespace to enable
cf> project references to be changed programmatically? My C# project
cf> files are stored in source control with DLL references but I want to
cf> be create a utility that changes the DLL references to project
cf> references in the project file. This is so that all of the projects
cf> can be run in debug but without having to manually change the
cf> references each time.
cf>
cf> Obviously I can use the Xml namespace but I was wondering if there's
cf> an easier way.
cf>
 
R

Robbe Morris - [MVP] C#

I know of no other way than manipulating the project files
manually. Peter Bromberg (EggHeadCafe) has written this sort of stuff.

http://www.eggheadcafe.com/articles/20030425.asp

--
Robbe Morris [Microsoft MVP - Visual C#]
AdvancedXL Server, Designer, and Data Analyzer
Convert cell ranges in Excel to rule driven web surveys
http://www.equalssolved.com/default.aspx




chris fellows said:
Because it is the best solution in our particular circumstances. I'm fully
aware of the pros and cons of both solutions.

Robbe Morris - [MVP] C# said:
Why do you store them in source control with DLL references
instead of project references?

--
Robbe Morris [Microsoft MVP - Visual C#]
AdvancedXL Server, Designer, and Data Analyzer
Convert cell ranges in Excel to rule driven web surveys
http://www.equalssolved.com/default.aspx




chris fellows said:
Can someone tell me if .NET 2.0 framework has a namespace to enable
project references to be changed programmatically? My C# project files
are stored in source control with DLL references but I want to be create
a utility that changes the DLL references to project references in the
project file. This is so that all of the projects can be run in debug
but without having to manually change the references each time.

Obviously I can use the Xml namespace but I was wondering if there's an
easier way.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top