Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Bug com.unity.ide.visualstudio is not pulling in Roslyn Analyzers / Source Generators from csc.rsp files

Discussion in 'Code Editors & IDEs' started by dvir7, Aug 31, 2022.

  1. dvir7

    dvir7

    Joined:
    Jan 3, 2019
    Posts:
    1
    Both com.unity.ide.rider and com.unity.ide.vscode correctly look at response files for analyzers (roslyn / source generators), while the Visual Studio variant doesn't. It only looks at assembly compile options dll references.

    This is preventing a nicer integration with analyzers that doesn't require dropping a dll into the project.

    The fix is rather simple - copying over the RetrieveRoslynAnalyzers and GetOtherArgumentsFromResponseFilesData methods from those other packages' ProjectGeneration.cs and using it in ProjectGeneration.ProjectHeader().
     
  2. sailro

    sailro

    Microsoft

    Joined:
    Jul 30, 2014
    Posts:
    167
    Hello, we added this in the upcoming v2.0.17 of the VS Editor package.

    Thanks!