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

Is there a way to get Devenv to ignore build dependencies ?

P: n/a
I am wondering if there is a devenv switch that will ignore build
dependencies that are set in .xxproj files. At the command line I am
attempting to build individual projects that I do not want subjected to the
build dependencies set in the project files.
Jun 6 '07 #1
Share this Question
Share on Google+
6 Replies


P: n/a
Resubmitting same questions due to MSDN setup configuration problems did not
get my questions past filters.

"apr0524" wrote:
I am wondering if there is a devenv switch that will ignore build
dependencies that are set in .xxproj files. At the command line I am
attempting to build individual projects that I do not want subjected to the
build dependencies set in the project files.
Jun 13 '07 #2

P: n/a
Hi,

Since you didn't tell us which version of Visual Studio you're using, I
assume you're using VS2005 and you are probably using following command
line to build a project in a solution:

devenv Solution1.sln /build debug /project
ConsoleApplication1\ConsoleApplication1.csproj

And you found out since the ConsoleApplication1 depends on another project
in the solution, the another project is also built before building
ConsoleApplication1.

If this is the case, you can use msbuild
(%windir%\Microsoft.NET\Framework\v2.0.50727\MSBui ld.exe) to build the
project alone, the project build dependency is stored in the solution file;
when you use msbuild to build the project file alone, dependent project
will not be built first.

However, please note if a project references another project, then in
either case, the referenced project will always be built first.

For more information about msbuild, please see this page:

#MSBuild Command Line Reference
http://msdn2.microsoft.com/en-us/library/ms164311.aspx
Hope this helps. Please reply here to let me know if there's anything else
I can help.

Regards,
Walter Wang (wa****@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

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

Jun 14 '07 #3

P: n/a
Walter,

Thank you for your reply. Actually we have a mixed VS2003 and VS2005
environment. I will try your suggestion for VS2005 using msbuild. However,
I am still wondering if there is a method in VS2003 to ignore build
dependencies?

Reason I am looking to do this is we build .NET projects grouped together in
a makefilefile called via omake in order to get ClearCase configuration
records for our built deliverables. ClearCase configuration records
generated for deliverables built from a .sln file include entries that imply
a circular dependency between the deliverables even when there are no
dependencies. Just the fact that the deliverables build from the same
solution file creates this undesirable effect on the ClearCase configuration
record. These config recs are then basically usless as a tool for source
impact analysis. I am looking to code dependencies in the makefile for the
individual projects. Building individual projects via the .xxproj file has
been successful in creating a "good" config rec for projects that have no
dependencies coded in the solution file. So now I am looking for a way to
ignore the dependencies coded in the solution and project files since I have
the actual dependencies coded in my makefile.

Thanks for you time.

"Walter Wang [MSFT]" wrote:
Hi,

Since you didn't tell us which version of Visual Studio you're using, I
assume you're using VS2005 and you are probably using following command
line to build a project in a solution:

devenv Solution1.sln /build debug /project
ConsoleApplication1\ConsoleApplication1.csproj

And you found out since the ConsoleApplication1 depends on another project
in the solution, the another project is also built before building
ConsoleApplication1.

If this is the case, you can use msbuild
(%windir%\Microsoft.NET\Framework\v2.0.50727\MSBui ld.exe) to build the
project alone, the project build dependency is stored in the solution file;
when you use msbuild to build the project file alone, dependent project
will not be built first.

However, please note if a project references another project, then in
either case, the referenced project will always be built first.

For more information about msbuild, please see this page:

#MSBuild Command Line Reference
http://msdn2.microsoft.com/en-us/library/ms164311.aspx
Hope this helps. Please reply here to let me know if there's anything else
I can help.

Regards,
Walter Wang (wa****@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

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

Jun 14 '07 #4

P: n/a
Well, the ProjectDependencies configuration in the solution file is
designed to be used. I don't think there's a switch to ignore the
dependencies.

However, I think it's easy to create some script to remove the dependencies
from the solution file, since you already have the correct build order from
the make file, then using this cleaned solution file to build the project
will be fine.

The solution file is a text file, the dependencies are written such as:

Microsoft Visual Studio Solution File, Format Version 8.00
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "WindowsApplication1",
"WindowsApplication1\WindowsApplication1.vbpro j",
"{144E63EE-2B98-43AA-A9A2-8EB4122CD59D}"
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ClassLibrary1",
"ClassLibrary1\ClassLibrary1.csproj",
"{31B6D86E-3E15-42EE-9B2F-D0DEDC5FE4E2}"
ProjectSection(ProjectDependencies) = postProject
{144E63EE-2B98-43AA-A9A2-8EB4122CD59D} =
{144E63EE-2B98-43AA-A9A2-8EB4122CD59D}
EndProjectSection
EndProject
It should be easy to use a regular expression to remove the content
enclosed the ProjectDependencies:

Search for:

ProjectSection\(ProjectDependencies\)\s*=\s*(\w+). *?EndProjectSection

and replace with:

ProjectSection(ProjectDependencies) = \1
EndProjectSection

Here's the C# code used to replace the text:

Regex RegexObj = new
Regex("ProjectSection\\(ProjectDependencies\\)\\s* =\\s*(\\w+).*?EndProjectSe
ction", RegexOptions.Singleline | RegexOptions.IgnoreCase);
ResultString = RegexObj.Replace(SubjectString,
"ProjectSection(ProjectDependencies) = $1\r\nEndProjectSection");
Hope this helps.
Regards,
Walter Wang (wa****@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

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

Jun 15 '07 #5

P: n/a
Hi,

If you see this, please reply here to let me know the status of this post.
Thanks.
Regards,
Walter Wang (wa****@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

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

Jun 21 '07 #6

P: n/a
Hi Anne,

In the project file, you can find content such as:

<PropertyGroup Condition=" '$(Configuration)|$(Platform)' ==
'Release|AnyCPU' ">

This means the property "Configuration" and "Platform" must have specified
values to make the proeprty group take effect. Therefore, to build the
configuration "Release", you should use following command line:

msbuild annesproject.csproj /property:Configuration=Release

The is assume that the property "Platform" has default value "AnyCPU"; but
you can also specify the Platform property on the command line:

msbuild annesproject.csproj /property:Configuration=Release
/property:Platform=AnyCPU
Hope this helps.
Regards,
Walter Wang (wa****@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

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

Jul 26 '07 #7

This discussion thread is closed

Replies have been disabled for this discussion.