DocFileItem defined incorrectly in Microsoft.CSharp.targets ?



    I noticed a discrepency in the way that Microsoft.CSharp.targets and Microsoft.VisualBasic.targets define the "DocFileItem" item.  I suspect that this was unintentional and that Microsoft.CSharp.targets has it wrong and that Microsoft.VisualBasic.targets has it right.  The C# targets file doesn't provide the same possibility of controlling where the intermediate output goes like the VB targets file does.

    Microsoft.CSharp.targets contains:

            <DocFileItem Include="$(DocumentationFile)" Condition="'$(DocumentationFile)'!=''"/>

    ...whereas Microsoft.VisualBasic.targets contains:

            <DocFileItem Include="$(IntermediateOutputPath)$(DocumentationFile)"  Condition="'$(DocumentationFile)'!=''"/>

    Thursday, June 08, 2006 7:01 PM


  • Hi Bern,

    Well spotted, but I think this was intentional on the part of MSBuild at least. The C# project system writes a property like this to the .csproj:


    while the VB project system writes a property like this to the .vbproj:


    In other words, the VB project system doesn't offer the ability to change where the file goes: it's implicitly in the intermediate output directory, so we have to pre-pend that directory in the VB case.

    Probably the project systems should be consistent, they were just inconsistent by accident I should think.

    I'm not sure exactly what you are trying to do -- if you want to change where the C# .xml file goes, you can just change the value in the project file I think?



    Friday, June 16, 2006 8:00 PM