471,338 Members | 1,392 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,338 software developers and data experts.

Set Project setting in Solution

Hi

I have a solution with 50 projects. They are all compiled in DEBUG mode and
the output path has been modified to a custom directory

I now want to build RELEASE mode and the Output Path needs to be reset for
all the project to the custom directory

Is there an easy way to do this besides opening 50 projects???

- I was going to write a pgm to go to all directories and csproj files and
edit that property ??? Anything easier???

Thanks

Aug 19 '08 #1
5 3725
Hello sippyuconn,

Are your 50 projects in one solution (sln)? If yes, I may have an easier
way to build the projects in Release mode.

First, let's look at a sample sln file:

================================================
Microsoft Visual Studio Solution File, Format Version 10.00
# Visual Studio 2008
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ExcelWorkbook4",
"ExcelWorkbook4\ExcelWorkbook4.csproj",
"{63A08F02-7E57-40FB-A330-651A4078531B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ClassLibrary1",
"ClassLibrary1\ClassLibrary1.csproj",
"{98195D15-6E19-4798-9FF9-0A2D05F7CF2C}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{63A08F02-7E57-40FB-A330-651A4078531B}.Debug|Any CPU.ActiveCfg =
Debug|Any CPU
{63A08F02-7E57-40FB-A330-651A4078531B}.Debug|Any CPU.Build.0 = Debug|Any
CPU
{63A08F02-7E57-40FB-A330-651A4078531B}.Release|Any CPU.ActiveCfg =
Release|Any CPU
{63A08F02-7E57-40FB-A330-651A4078531B}.Release|Any CPU.Build.0 =
Release|Any CPU
{98195D15-6E19-4798-9FF9-0A2D05F7CF2C}.Debug|Any CPU.ActiveCfg =
Debug|Any CPU
{98195D15-6E19-4798-9FF9-0A2D05F7CF2C}.Debug|Any CPU.Build.0 = Debug|Any
CPU
{98195D15-6E19-4798-9FF9-0A2D05F7CF2C}.Release|Any CPU.ActiveCfg =
Release|Any CPU
{98195D15-6E19-4798-9FF9-0A2D05F7CF2C}.Release|Any CPU.Build.0 =
Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
================================================

This sln will build its projects to Debug Mode. We can update the
postSolution section to:

GlobalSection(ProjectConfigurationPlatforms) = postSolution
{63A08F02-7E57-40FB-A330-651A4078531B}.Debug|Any CPU.ActiveCfg =
Release|Any CPU
{63A08F02-7E57-40FB-A330-651A4078531B}.Debug|Any CPU.Build.0 =
Release|Any CPU
{63A08F02-7E57-40FB-A330-651A4078531B}.Release|Any CPU.ActiveCfg =
Release|Any CPU
{63A08F02-7E57-40FB-A330-651A4078531B}.Release|Any CPU.Build.0 =
Release|Any CPU
{98195D15-6E19-4798-9FF9-0A2D05F7CF2C}.Debug|Any CPU.ActiveCfg =
Release|Any CPU
{98195D15-6E19-4798-9FF9-0A2D05F7CF2C}.Debug|Any CPU.Build.0 =
Release|Any CPU
{98195D15-6E19-4798-9FF9-0A2D05F7CF2C}.Release|Any CPU.ActiveCfg =
Release|Any CPU
{98195D15-6E19-4798-9FF9-0A2D05F7CF2C}.Release|Any CPU.Build.0 =
Release|Any CPU
EndGlobalSection

And build the solution (not the individual projects), to get the Release
outputs.

Hope it helps.

Regards,
Jialiang Ge (ji****@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
ms****@microsoft.com.

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/en-us/subs...#notifications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://support.microsoft.com/select/...tance&ln=en-us.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
Aug 19 '08 #2
Hi Thanks for the reply

The 50 projects are in 1 solution - the issue is not so much DEBUG/RELEASE
but the out put path

<OutputPath>..\..\EXE\</OutputPath>

In DEBUG mode all these paths were changed to above for testing - now we
need to change for RELEASE - I was looking for an easy way to do that??
Project1

<Project ToolsVersion="3.5" DefaultTargets="Build"
xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == ''
">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.21022</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{E8F17DC3-25E9-4822-8C23-808BFBBF1652}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>DbMetaData</RootNamespace>
<AssemblyName>DbMetaData</AssemblyName>
<TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' ==
'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>..\..\EXE\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' ==
'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>

Project 2

<Project ToolsVersion="3.5" DefaultTargets="Build"
xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == ''
">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.21022</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{DA6168C4-C21D-441A-BF1A-16BD89A50DC1}</ProjectGuid>
<OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>BuildMetaDataFromDb</RootNamespace>
<AssemblyName>BuildMetaDataFromDb</AssemblyName>
<TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' ==
'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>..\..\EXE\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' ==
'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>


""Jialiang Ge [MSFT]"" wrote:
Hello sippyuconn,

Are your 50 projects in one solution (sln)? If yes, I may have an easier
way to build the projects in Release mode.

First, let's look at a sample sln file:

================================================
Microsoft Visual Studio Solution File, Format Version 10.00
# Visual Studio 2008
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ExcelWorkbook4",
"ExcelWorkbook4\ExcelWorkbook4.csproj",
"{63A08F02-7E57-40FB-A330-651A4078531B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ClassLibrary1",
"ClassLibrary1\ClassLibrary1.csproj",
"{98195D15-6E19-4798-9FF9-0A2D05F7CF2C}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{63A08F02-7E57-40FB-A330-651A4078531B}.Debug|Any CPU.ActiveCfg =
Debug|Any CPU
{63A08F02-7E57-40FB-A330-651A4078531B}.Debug|Any CPU.Build.0 = Debug|Any
CPU
{63A08F02-7E57-40FB-A330-651A4078531B}.Release|Any CPU.ActiveCfg =
Release|Any CPU
{63A08F02-7E57-40FB-A330-651A4078531B}.Release|Any CPU.Build.0 =
Release|Any CPU
{98195D15-6E19-4798-9FF9-0A2D05F7CF2C}.Debug|Any CPU.ActiveCfg =
Debug|Any CPU
{98195D15-6E19-4798-9FF9-0A2D05F7CF2C}.Debug|Any CPU.Build.0 = Debug|Any
CPU
{98195D15-6E19-4798-9FF9-0A2D05F7CF2C}.Release|Any CPU.ActiveCfg =
Release|Any CPU
{98195D15-6E19-4798-9FF9-0A2D05F7CF2C}.Release|Any CPU.Build.0 =
Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
================================================

This sln will build its projects to Debug Mode. We can update the
postSolution section to:

GlobalSection(ProjectConfigurationPlatforms) = postSolution
{63A08F02-7E57-40FB-A330-651A4078531B}.Debug|Any CPU.ActiveCfg =
Release|Any CPU
{63A08F02-7E57-40FB-A330-651A4078531B}.Debug|Any CPU.Build.0 =
Release|Any CPU
{63A08F02-7E57-40FB-A330-651A4078531B}.Release|Any CPU.ActiveCfg =
Release|Any CPU
{63A08F02-7E57-40FB-A330-651A4078531B}.Release|Any CPU.Build.0 =
Release|Any CPU
{98195D15-6E19-4798-9FF9-0A2D05F7CF2C}.Debug|Any CPU.ActiveCfg =
Release|Any CPU
{98195D15-6E19-4798-9FF9-0A2D05F7CF2C}.Debug|Any CPU.Build.0 =
Release|Any CPU
{98195D15-6E19-4798-9FF9-0A2D05F7CF2C}.Release|Any CPU.ActiveCfg =
Release|Any CPU
{98195D15-6E19-4798-9FF9-0A2D05F7CF2C}.Release|Any CPU.Build.0 =
Release|Any CPU
EndGlobalSection

And build the solution (not the individual projects), to get the Release
outputs.

Hope it helps.

Regards,
Jialiang Ge (ji****@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
ms****@microsoft.com.

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/en-us/subs...#notifications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://support.microsoft.com/select/...tance&ln=en-us.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
Aug 19 '08 #3
Hello Nick,

I am writing to check the status of the issue on your side. Would you mind
letting me know the result of the suggestions? Please let me know your
concerns and I will do my best to find the workarounds for you.

Have a great day!

Regards,
Jialiang Ge (ji****@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

=================================================
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
ms****@microsoft.com.

This posting is provided "AS IS" with no warranties, and confers no rights.
=================================================

Aug 21 '08 #4
Hi

Your suggestion did not address my issue

I was concerned about changing the Output path on each project(50)
If I have edited the Path for Debug and I want to have that Path for Release
- I need to edit 50 projects

I was going to write a script to go thru 50 .csproj file

Is there an easier way???
-macro ???
etc

Thanks
""Jialiang Ge [MSFT]"" wrote:
Hello Nick,

I am writing to check the status of the issue on your side. Would you mind
letting me know the result of the suggestions? Please let me know your
concerns and I will do my best to find the workarounds for you.

Have a great day!

Regards,
Jialiang Ge (ji****@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

=================================================
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
ms****@microsoft.com.

This posting is provided "AS IS" with no warranties, and confers no rights.
=================================================

Aug 21 '08 #5
Hello

Please try this macro:

It enumerates all the projects in the solution and reset the output path of
the release build with
proj.ConfigurationManager.Item(2).Properties.Item( "OutputPath").Value =
outputPath

************************************************** ************
Public Sub ResetSolutionReleaseOutput()
Dim project As Project
Dim projectObjects As EnvDTE.Projects

Dim outputPath = "bin\Test"
'get all the projects in the current solution
projectObjects = DTE.Solution.Projects

For Each project In projectObjects
ResetOutputPath(project, outputPath)
Next

End Sub

Sub ResetOutputPath(ByVal proj As Project, ByVal outputPath As String)
If (proj.Kind = "{66A26720-8FB5-11D2-AA7E-00C04F688DDE}") Then
' a folder
' check the sub items
Dim projectItem As EnvDTE.ProjectItem
For Each projectItem In proj.ProjectItems
If Not (projectItem.SubProject Is Nothing) Then
' Recurse, can be an Enterprise project in
' Visual Studio .NET 2002/2003 or a solution folder in
VS 2005
ResetOutputPath(projectItem.SubProject, outputPath)
End If
Next
Else

proj.ConfigurationManager.Item(2).Properties.Item( "OutputPath").Value =
outputPath
End If
End Sub
************************************************** ************

Please let me know whether it works for you. If you have any other
questions or concerns, DON'T hesitate to tell me

Have a nice weekend!
Regards,
Jialiang Ge (ji****@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

=================================================
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
ms****@microsoft.com.

This posting is provided "AS IS" with no warranties, and confers no rights.
=================================================

Aug 22 '08 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by Arun Bhalla | last post: by
1 post views Thread by Vladimír Kolesnik | last post: by
reply views Thread by Joe Greene | last post: by
4 posts views Thread by Hardy Wang | last post: by
6 posts views Thread by Andrew Rowley | last post: by
reply views Thread by rosydwin | last post: by

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.