Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6719413
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T09:05:25+00:00 2026-05-26T09:05:25+00:00

While chasing incremental build time improvements, I found that .btproj files and thus all

  • 0

While chasing incremental build time improvements, I found that .btproj files and thus all other projects that depend on these are rebuilt (partly) on each incremental build. Tracking this all the way to BizTalkCommon.targets, I found that it does a 2 pass compilation of the assembly – but only the first pass respects already built artifacts, thus breaking the incremental part of the dependency chain. The offending target can be seen in BizTalkCommon.targets (line 228):

<!-- Delete the assembly and rerun the build process -->
<Target Name="SecondPass"
        Condition="$(SecondBuild)!=true and $(TempAssemblyOnly)!=true">

    <Delete Files="@(IntermediateAssembly)" />
    <MSBuild Projects="$(MSBuildProjectFile)" Properties="SecondBuild=true"/>
</Target>

I realize that there’s a reason for the 2 pass build, but simply cannot believe it wouldn’t be possible to specify appropriate in- and outputs for the target to handle incremental builds correctly.

Does anyone know if there’s a patch for the .targets file, or if there’s another good reason that incremental builds aren’t supported?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T09:05:25+00:00Added an answer on May 26, 2026 at 9:05 am

    You can enable incremental compilation of MSBuild BizTalk project with a couple of very simple changes. Basically, you need to override two targets that are defined in the BizTalkCommon.targets file.

    Those targets can be overriden in your own .btproj files and do not require modifying the original .targets file that ships with BizTalk.

    How To

    First Create you own .targets file to host your customizations, for instance BizTalkCustom.targets :

    <Import Project="$(MSBuildExtensionsPath)\Microsoft\BizTalk\BizTalkC.targets" />
    
    <!-- Rerun the build process (second pass) -->
    <Target Name="SecondPass" Condition="$(SecondBuild)!=true and $(TempAssemblyOnly)!=true and @(XLang)!=''">
        <MSBuild Projects="$(MSBuildProjectFile)" Properties="SecondBuild=true" />
    </Target>
    
    <!-- Compile XLang/s orchestration -->
    <Target
        Name="CompileODX"
        Condition="$(SecondBuild)==true"
        Inputs="@(XLang);$(MSBuildAllProjects);$(ClrTypesAssembly)"
        Outputs="$(BuildDone)">
    
      <!-- Delete previously generated C# files from XLang compilation -->
      <Delete Files="@(IntermediateAssembly)" />
      <Delete Files="@(CSharpOutputFromXLang)" />
    
      <XLangTask XLangItems="@(XLang)"
                 ProjectReferences="@(ReferencePath)"
                 WarningLevel="$(WarningLevel)"
                 BpelCompliance="$(BpelCompliance)"
                 DefineConstants="$(DefineConstants)"
                 TreatWarningsAsErrors="$(TreatWarningsAsErrors)"
                 TempAssembly="$(ClrTypesAssembly)"
                 OutputDirectory="$(XLangOutputPath)">
      </XLangTask>
    </Target>
    

    Then, replace the last Import statement in your .btproj file:

      <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
      <Import Project="$(MyCustomExtensions)\BizTalkCustom.targets" />
    

    How doe it work

    BizTalk Server projects need somehow to be compiled in two passes. The first pass compiles schemas, maps and pipelines, whereas the second pass compiles orchestrations.

    You’ll notice that the overriden targets are very very similar than the original ones, defined inside the BizTalkCommon.targets file. In fact, I made two simple changes:

    1. The first change involves modifying the SecondPass Target and adding an extra test in the Conditionattribute. This test is usefull to prevent the second pass from occurring if your project does not even have Orchestrations.

    2. Unfortunately, if your project contains Orchestrations, the original SecondPass Target deletes the intermediate assemblies and then proceed to compile the Orchestrations. However, the CompileODX Target does not need to run if all files are already up to date. Therefore, the second change involves moving the Delete Task from the SecondPass Target to the CompiledODX Target.

    That’s all there is to it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

While Ctrl X works fine in vim under windows, Ctrl A selects all (duh).
While Joel Spolsky thinks that every bug should be fixed before new code is
While reading from a site a read that you can not make a global
While going through the checkBox I found there is written CheckBox checkbox = (CheckBox)sender
We just spent some time chasing down some really weird jQuery/css behavior in IE7/8.
While developing a new site I stop periodically and test all new functionality in
While using jQuery's autocomplete, I've noticed that characters & and ' are escaped as
While working with ASP.NET MVC, I have noticed that exception messages issued by the
While the C# spec does include a pre-processor and basic directives (#define, #if, etc),
While going through university and from following the development of SO, I've heard a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.