none
DocFileItem defined incorrectly in Microsoft.CSharp.targets ?

    Question

  •  

    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:

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

    ...whereas Microsoft.VisualBasic.targets contains:

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

    Thursday, June 08, 2006 7:01 PM

Answers

  • 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:

        <DocumentationFile>bin\Debug\WindowsApplication4.XML</DocumentationFile>

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

        <DocumentationFile>WindowsApplication4.xml</DocumentationFile>

    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?

    Dan

     

    Friday, June 16, 2006 8:00 PM
    Moderator