Closed AydinE closed 5 months ago
I get these errors still on this branch: Build log.txt
@sarahelsaig you don't?
This pull request has merge conflicts. Please resolve those before requesting a review.
It works flawlessly on Rider and the dotnet
CLI, but I get errors only in Visual Studio (the IE of IDEs). The actual errors can be ignored because they are straightforwardly caused by the missing generated constants. So only look at the warnings:
Generator 'ConstantFromJsonGenerator' failed to generate source. It will not contribute to the output and compilation errors may occur as a result. Exception was of type 'FileNotFoundException' with message 'Could not load file or assembly 'System.Text.Json, Version=7.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The system cannot find the file specified.'.
This happens in Lombiq.BaseTheme, Lombiq.HelpfulLibraries.Tests, and Lombiq.VueJs, so all three projects that actually use the source generator. Of course System.Text.Json is part of the .NET runtime and it does work outside of Visual Studio so I'm not sure what this could mean.
Also fwiw I got this interesting IntelliSense-only warning only for Lombiq.BaseTheme, suggesting that the Lombiq.BaseTheme\package.json may have something malformed in it:
Warning CS8785 Generator 'ConstantFromJsonGenerator' failed to generate source. It will not contribute to the output and compilation errors may occur as a result. Exception was of type 'ArgumentException' with message 'An item with the same key has already been added. Key: E:\Repositories\orchard-core\Open-Source-Orchard-Core-Extensions\src\Themes\Lombiq.BaseTheme\Lombiq.BaseTheme\package.json'.
System.ArgumentException: An item with the same key has already been added. Key: E:\Repositories\orchard-core\Open-Source-Orchard-Core-Extensions\src\Themes\Lombiq.BaseTheme\Lombiq.BaseTheme\package.json
at System.Collections.Generic.Dictionary`2.TryInsert(TKey key, TValue value, InsertionBehavior behavior)
at System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value)
at Lombiq.HelpfulLibraries.SourceGenerators.ConstantFromJsonGenerator.<Initialize>b__3_6(SourceProductionContext _, ImmutableArray`1 contents)
at Microsoft.CodeAnalysis.UserFunctionExtensions.<>c__DisplayClass3_0`2.<WrapUserAction>b__0(TInput1 input1, TInput2 input2, CancellationToken token)
-----
Lombiq.BaseTheme E:\Repositories\orchard-core\Open-Source-Orchard-Core-Extensions\src\Themes\Lombiq.BaseTheme\Lombiq.BaseTheme\Lombiq.BaseTheme.csproj 1 IntelliSense Active
(but this may be a red herring, since it works fine outside of VS)
Any news, @AydinE? It's a large issue that builds under VS is broken. If you can't fix this ASAP, then please revert all the changed in dev
to unblock everyone.
This pull request has merge conflicts. Please resolve those before requesting a review.
OSOE-819 Potentially fixes https://github.com/Lombiq/Helpful-Libraries/issues/238#issuecomment-2010522784
@Piedone weirdly I can't seem to reproduce the situation from your comment even with a completely fresh clone of OSOCE, the builds and tests within the pipeline also all seem to not have any issues.
EDIT: It does seem like this time around the build did fail on this same issue: https://github.com/Lombiq/Open-Source-Orchard-Core-Extensions/actions/runs/8373846561/job/22927800545?pr=727#step:6:162