none
AdditionalFiles on Csproj files RRS feed

  • Question

  • Hello,

    When we add new AdditionalFiles section on CSPROJ, this files is included inside the builded assembly ? Or the additional files is just used by roslyn analyzer to do its job and never included into the builded assembly ? It's safe to add private information into AdditionalFiles ?

    Thanks


    Tuesday, April 23, 2019 4:06 PM

Answers

  • As discussed here, additional files is just a mechanism for passing data to analyzers. It doesn't impact compilation. 

    However I wouldn't recommend you use it for your own purposes unless you're building an analyzer. If you need to add data to a project file then just create your own properties. MSBuild doesn't try to understand all the properties in the file. It just defines them.

    <PropertyGroup>
       <MyFirstValue>1</MyFirstValue>
       <AnotherValue>MyFile.cs</AnotherValue>
    </PropertyGroup>


    Michael Taylor http://www.michaeltaylorp3.net

    Tuesday, April 23, 2019 5:55 PM
    Moderator

All replies

  • As discussed here, additional files is just a mechanism for passing data to analyzers. It doesn't impact compilation. 

    However I wouldn't recommend you use it for your own purposes unless you're building an analyzer. If you need to add data to a project file then just create your own properties. MSBuild doesn't try to understand all the properties in the file. It just defines them.

    <PropertyGroup>
       <MyFirstValue>1</MyFirstValue>
       <AnotherValue>MyFile.cs</AnotherValue>
    </PropertyGroup>


    Michael Taylor http://www.michaeltaylorp3.net

    Tuesday, April 23, 2019 5:55 PM
    Moderator
  • Hi

    Is your problem solved? If so, please post "Mark as answer" to the appropriate answer, so that it will help other members to find the solution quickly if they face a similar issue.

    Best Regards,

    Jack


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Tuesday, May 7, 2019 8:15 AM
    Moderator
  • Hi

    Thank you for your reply :)

    Thomas

    Tuesday, May 7, 2019 8:19 AM