Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

Bug Any <AdditionFiles /> in .csproj breaks source generators

Discussion in 'Experimental Scripting Previews' started by tertle, Nov 24, 2022.

  1. tertle

    tertle

    Joined:
    Jan 25, 2011
    Posts:
    3,761
    Cross posted to Data Oriented Technology Stack as I wasn't sure exactly who it related to
    https://forum.unity.com/threads/any-additionfiles-in-csproj-breaks-source-generators.1365507/

    This might be a Rider issue, I'm not sure.

    Any <AdditionFiles /> in .csproj breaks source generators

    Code (CSharp):
    1.   <ItemGroup>
    2.     <Analyzer Include="RoslynAnalyzers\StyleCop.Analyzers.CodeFixes.dll" />
    3.     <Analyzer Include="RoslynAnalyzers\StyleCop.Analyzers.dll" />
    4.     <AdditionalFiles Include="RoslynAnalyzers\stylecop.json" />
    5.   </ItemGroup>
    6.  
    No source generators from entities/collections/etc in the ide
    upload_2022-11-24_22-42-11.png
    Only some weird stuff from Unity.SourceGenerators

    Code (CSharp):
    1.   <ItemGroup>
    2.     <Analyzer Include="RoslynAnalyzers\StyleCop.Analyzers.CodeFixes.dll" />
    3.     <Analyzer Include="RoslynAnalyzers\StyleCop.Analyzers.dll" />
    4.   </ItemGroup>
    Generate as expected
    upload_2022-11-24_22-40-49.png

    .csproj files diff identically apart from this line
     
    Last edited: Nov 24, 2022
  2. HaraldNielsen

    HaraldNielsen

    Unity Technologies

    Joined:
    Jun 8, 2016
    Posts:
    139
    Hi, can you report a bug?
    Easier to know what Rider package ect you have in the project when its a bug :) Then we know where the bug should go to
     
  3. Seromu

    Seromu

    Joined:
    Nov 30, 2015
    Posts:
    34
  4. HaraldNielsen

    HaraldNielsen

    Unity Technologies

    Joined:
    Jun 8, 2016
    Posts:
    139
    @Seromu Just fixed that, sorry for the bug. The regression is in 2022.2 and newer. Its in the process of getting merged into 2022.2, and out to you asap
     
    Seromu likes this.