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

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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.
 
Resubmitting same questions due to MSDN setup configuration problems did not
get my questions past filters.
 
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\MSBuild.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 ([email protected], 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.
 
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.
 
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.vbproj",
"{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 ([email protected], 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.
 
Hi,

If you see this, please reply here to let me know the status of this post.
Thanks.


Regards,
Walter Wang ([email protected], 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.
 
Hi Walter,

Sorry it has taken me so long to get back to this. Your responses have been
very helpful and I have been working on implementation. My progress has been
slow due to other priorities.

For my VS2005 projects I have tested using MSbuild on the .csproj files with
my build dependencies coded in a makefile driver. I did receive the desired
results and my ClearCase configuration records no longer show the circular
dependendency between independent deliverables like they do when built from a
master solution file.

I have been looking at the MSBuild command line reference document that you
pointed me at, but I still have a question. My test building was just a
simple execution of :

MSbuild annesproject.csproj

And it built the debug configuration. How do I distinguish between the
debug and release configuration? Is it like DEVENV I just identify either
debug or release before the project name? MSbuild release
annesproject.csproj ???

I have been looking all over for this information and I can't find it. I
keep seeing references to calling specifics targets in the .csporj file,
thinking my project file may have a separate debug and release targets, but I
don't anything like that in my project file either.

Any additional help you could provide would be great.

Thanks,
Anne

Here is my project file:

<Project DefaultTargets="Build"
xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectType>Local</ProjectType>
<ProductVersion>8.0.50727</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{324E4D94-E183-4CD8-B881-DAF371D1FE76}</ProjectGuid>
<Configuration Condition=" '$(Configuration)' == ''
">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ApplicationIcon>
</ApplicationIcon>
<AssemblyKeyContainerName>
</AssemblyKeyContainerName>
<AssemblyName>Honeywell.CBProvider</AssemblyName>
<AssemblyOriginatorKeyFile>Provider.snk</AssemblyOriginatorKeyFile>
<DefaultClientScript>JScript</DefaultClientScript>
<DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
<DefaultTargetSchema>IE50</DefaultTargetSchema>
<DelaySign>false</DelaySign>
<OutputType>Library</OutputType>
<RootNamespace>Honeywell.CBProvider</RootNamespace>
<RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent>
<StartupObject>
</StartupObject>
<FileUpgradeFlags>
</FileUpgradeFlags>
<UpgradeBackupLocation>
</UpgradeBackupLocation>
<SignAssembly>true</SignAssembly>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' ==
'Debug|AnyCPU' ">
<OutputPath>exe\</OutputPath>
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
<BaseAddress>285212672</BaseAddress>
<CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
<ConfigurationOverrideFile>
</ConfigurationOverrideFile>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DocumentationFile>
</DocumentationFile>
<DebugSymbols>true</DebugSymbols>
<FileAlignment>4096</FileAlignment>
<NoStdLib>false</NoStdLib>
<NoWarn>
</NoWarn>
<Optimize>false</Optimize>
<RegisterForComInterop>false</RegisterForComInterop>
<RemoveIntegerChecks>false</RemoveIntegerChecks>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<WarningLevel>4</WarningLevel>
<DebugType>full</DebugType>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' ==
'Release|AnyCPU' ">
<OutputPath>exe\</OutputPath>
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
<BaseAddress>285212672</BaseAddress>
<CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
<ConfigurationOverrideFile>
</ConfigurationOverrideFile>
<DefineConstants>TRACE</DefineConstants>
<DocumentationFile>
</DocumentationFile>
<DebugSymbols>false</DebugSymbols>
<FileAlignment>4096</FileAlignment>
<NoStdLib>false</NoStdLib>
<NoWarn>
</NoWarn>
<Optimize>true</Optimize>
<RegisterForComInterop>false</RegisterForComInterop>
<RemoveIntegerChecks>false</RemoveIntegerChecks>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<WarningLevel>4</WarningLevel>
<DebugType>none</DebugType>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<ItemGroup>
<Reference Include="EHI_NET">
<Name>EHI_NET</Name>

<HintPath>z:\error_handling\ehi_dotnet\ehinfra3_dotnet\exe\EHI_NET.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Honeywell.CDF.Application.Interfaces,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=5dc3da0218c3e400,
processorArchitecture=MSIL">

<HintPath>Z:\externals_replctd\SCAN\ConfigurationStudio\exe\Honeywell.CDF.Application.Interfaces.dll</HintPath>
<SpecificVersion>False</SpecificVersion>
<Private>False</Private>
</Reference>
<Reference Include="Honeywell.CDF.ConfigStudio.Interfaces,
Version=3.0.0.0, Culture=neutral, PublicKeyToken=5dc3da0218c3e400,
processorArchitecture=MSIL">

<HintPath>Z:\externals_replctd\SCAN\ConfigurationStudio\exe\Honeywell.CDF.ConfigStudio.Interfaces.dll</HintPath>
<SpecificVersion>False</SpecificVersion>
<Private>False</Private>
</Reference>
<Reference Include="Honeywell.CDF.EPKSTaskModelProvider,
Version=3.0.0.0, Culture=neutral, PublicKeyToken=5dc3da0218c3e400,
processorArchitecture=MSIL">

<HintPath>Z:\externals_replctd\SCAN\ConfigurationStudio\exe\Honeywell.CDF.EPKSTaskModelProvider.dll</HintPath>
<SpecificVersion>False</SpecificVersion>
<Private>False</Private>
</Reference>
<Reference Include="Honeywell.CDF.Framework.Interfaces, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=5dc3da0218c3e400, processorArchitecture=MSIL">

<HintPath>Z:\externals_replctd\SCAN\ConfigurationStudio\exe\Honeywell.CDF.Framework.Interfaces.dll</HintPath>
<SpecificVersion>False</SpecificVersion>
<Private>False</Private>
</Reference>
<Reference Include="Honeywell.CDF.HSCAuthenticationModule,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=5dc3da0218c3e400,
processorArchitecture=MSIL">

<HintPath>Z:\externals_replctd\SCAN\ConfigurationStudio\exe\Honeywell.CDF.HSCAuthenticationModule.dll</HintPath>
<SpecificVersion>False</SpecificVersion>
<Private>False</Private>
</Reference>
<Reference Include="System">
<Name>System</Name>
</Reference>
<Reference Include="System.Data">
<Name>System.Data</Name>
</Reference>
<Reference Include="System.Design">
<Name>System.Design</Name>
</Reference>
<Reference Include="System.Drawing">
<Name>System.Drawing</Name>
</Reference>
<Reference Include="System.Windows.Forms">
<Name>System.Windows.Forms</Name>
</Reference>
<Reference Include="System.Xml">
<Name>System.XML</Name>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="..\Common\Common.cs">
<Link>Common.cs</Link>
<SubType>Code</SubType>
</Compile>
<Compile Include="AssemblyInfo.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="CBProvider.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="WindowsMessagesHandler.cs">
<SubType>Form</SubType>
</Compile>
<EmbeddedResource Include="Images.resources" />
<EmbeddedResource Include="Strings.resources" />
<EmbeddedResource Include="WindowsMessagesHandler.resx">
<DependentUpon>WindowsMessagesHandler.cs</DependentUpon>
</EmbeddedResource>
<None Include="Provider.snk" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\CBProviderService\CBProviderService.csproj">
<Project>{B5EC9827-DEF9-4D4C-87ED-BFF41C472A86}</Project>
<Name>CBProviderService</Name>
<Private>False</Private>
</ProjectReference>
<ProjectReference
Include="..\EMBAuthenticationModule\EMBAuthenticationModule.csproj">
<Project>{358A0735-8C6D-4CD0-BCE0-96C54EC005E8}</Project>
<Name>EMBAuthenticationModule</Name>
<Private>False</Private>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PreBuildEvent>
</PreBuildEvent>
<PostBuildEvent>
</PostBuildEvent>
</PropertyGroup>
</Project>
 
* apr0524 wrote, On 14-6-2007 18:08:
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?

If you install MsBee you can build your 2003 projects with MsBuild as
well. It will take some work to get all your project files converted to
the new format though.

Jesse
 
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 ([email protected], 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.
 
Back
Top