Changing project references programmatically

Changing project references programmatically

am 02.01.2008 20:43:36 von 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.

Re: Changing project references programmatically

am 02.01.2008 21:23:33 von info

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" wrote in message
news:%23dCHHfXTIHA.4440@TK2MSFTNGP06.phx.gbl...
> 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.
>

Re: Changing project references programmatically

am 02.01.2008 21:47:38 von 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#" wrote in message
news:%232ZYh1XTIHA.2000@TK2MSFTNGP05.phx.gbl...
> 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" wrote in message
> news:%23dCHHfXTIHA.4440@TK2MSFTNGP06.phx.gbl...
>> 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.
>>
>

Re: Changing project references programmatically

am 03.01.2008 10:07:10 von nemtsev

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>

Re: Changing project references programmatically

am 03.01.2008 15:43:41 von info

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" wrote in message
news:Owdg5CYTIHA.4196@TK2MSFTNGP04.phx.gbl...
> 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#" wrote in message
> news:%232ZYh1XTIHA.2000@TK2MSFTNGP05.phx.gbl...
>> 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" wrote in message
>> news:%23dCHHfXTIHA.4440@TK2MSFTNGP06.phx.gbl...
>>> 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.
>>>
>>
>
>