Skip to content

Commit 5b65756

Browse files
authored
Always enable FixRoslynAnalyzerImportSettings in CLI
Always enable FixRoslynAnalyzerImportSettings to fix issue when our AssetPostprocessor isn't run early enough. Shouldn't be a issue as AssetPostprocessor will still run and sets the correct configuration.
1 parent f23df14 commit 5b65756

1 file changed

Lines changed: 1 addition & 7 deletions

File tree

src/NuGetForUnity.Cli/Program.cs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -67,20 +67,14 @@ public static int Main(string[] args)
6767
}
6868

6969
/// <summary>
70-
/// In Unity 2021 the errors that RoslynAnalyzer DLL's can't be imported because it has multiple files with the same name are blocking
70+
/// In Unity the errors that RoslynAnalyzer DLL's can't be imported because it has multiple files with the same name are blocking
7171
/// even before our AssetPostprocessor can change the import settings so Unity knows that the DLL is a RoslynAnalyzer.
7272
/// To bypass this error we generate the .dll.meta files with the RoslynAnalyzer label and the disable for platform configuration.
7373
/// A alternative could be to delete the duplicate .resources.dll files when restoring,
7474
/// but this would require to decide which user language to keep.
7575
/// </summary>
7676
private static void FixRoslynAnalyzerImportSettings()
7777
{
78-
if (int.Parse(Application.unityVersion.Split('.').First()) > 2021)
79-
{
80-
// in unity 2022 our AssetPostprocessor is handled before we get the errors for the RoslynAnalyzer DLL's
81-
return;
82-
}
83-
8478
if (!Directory.Exists(ConfigurationManager.NugetConfigFile.RepositoryPath))
8579
{
8680
return;

0 commit comments

Comments
 (0)