Building Library\Bee\artifacts\WinPlayerBuildProgram\ManagedStripped failed

Build failure when building with IL2CPP to Windows. Mono works fine. Please help!

Using Unity 2021.3.3f1 on a very old Window 10 Education Desktop (18362).

Tried: reinstall Windows SDK; Deleting Library Folder; Reimport all assets. None worked.

The failure seems to be related to a particular script in my project which you can see here. However I have no idea why this script is causing issue. It looks fine. If I create a fresh project that has this script it is able to be built without problem.

Error message in console:
8998861--1239571--upload_2023-5-8_2-3-44.png

Details for the first console error:

Building Library\Bee\artifacts\WinPlayerBuildProgram\u1oik\qtrz_ly-CSharp1.obj failed with output:
Assembly-CSharp1.cpp
D:\Projects\Unity\THYG\Library\Bee\artifacts\WinPlayerBuildProgram\il2cppOutput\cpp\Assembly-CSharp1.cpp(18981): error C2065: 'FixedSizeLinkedList_1_t3EAA698F222717A950BC3D871BB65D51F83F6B70': undeclared identifier
D:\Projects\Unity\THYG\Library\Bee\artifacts\WinPlayerBuildProgram\il2cppOutput\cpp\Assembly-CSharp1.cpp(18981): error C2065: 'V_0': undeclared identifier
D:\Projects\Unity\THYG\Library\Bee\artifacts\WinPlayerBuildProgram\il2cppOutput\cpp\Assembly-CSharp1.cpp(18996): error C2065: 'V_0': undeclared identifier
D:\Projects\Unity\THYG\Library\Bee\artifacts\WinPlayerBuildProgram\il2cppOutput\cpp\Assembly-CSharp1.cpp(18996): error C2065: 'FixedSizeLinkedList_1_t3EAA698F222717A950BC3D871BB65D51F83F6B70': undeclared identifier
D:\Projects\Unity\THYG\Library\Bee\artifacts\WinPlayerBuildProgram\il2cppOutput\cpp\Assembly-CSharp1.cpp(18996): error C2059: syntax error: ')'
D:\Projects\Unity\THYG\Library\Bee\artifacts\WinPlayerBuildProgram\il2cppOutput\cpp\Assembly-CSharp1.cpp(18997): error C2065: 'FixedSizeLinkedList_1_t3EAA698F222717A950BC3D871BB65D51F83F6B70': undeclared identifier
D:\Projects\Unity\THYG\Library\Bee\artifacts\WinPlayerBuildProgram\il2cppOutput\cpp\Assembly-CSharp1.cpp(18997): error C2065: 'L_2': undeclared identifier
D:\Projects\Unity\THYG\Library\Bee\artifacts\WinPlayerBuildProgram\il2cppOutput\cpp\Assembly-CSharp1.cpp(18997): error C2065: 'V_0': undeclared identifier
D:\Projects\Unity\THYG\Library\Bee\artifacts\WinPlayerBuildProgram\il2cppOutput\cpp\Assembly-CSharp1.cpp(18998): error C2065: 'FixedSizeLinkedList_1_t3EAA698F222717A950BC3D871BB65D51F83F6B70': undeclared identifier
D:\Projects\Unity\THYG\Library\Bee\artifacts\WinPlayerBuildProgram\il2cppOutput\cpp\Assembly-CSharp1.cpp(18998): error C2059: syntax error: ')'
D:\Projects\Unity\THYG\Library\Bee\artifacts\WinPlayerBuildProgram\il2cppOutput\cpp\Assembly-CSharp1.cpp(18999): error C2065: 'FixedSizeLinkedList_1_t3EAA698F222717A950BC3D871BB65D51F83F6B70': undeclared identifier
D:\Projects\Unity\THYG\Library\Bee\artifacts\WinPlayerBuildProgram\il2cppOutput\cpp\Assembly-CSharp1.cpp(18999): error C2059: syntax error: ')'
D:\Projects\Unity\THYG\Library\Bee\artifacts\WinPlayerBuildProgram\il2cppOutput\cpp\Assembly-CSharp1.cpp(19048): error C2065: 'HashSet_1_tA1368DD5977A2271895CEEC3D6282C68C9675735': undeclared identifier
D:\Projects\Unity\THYG\Library\Bee\artifacts\WinPlayerBuildProgram\il2cppOutput\cpp\Assembly-CSharp1.cpp(19048): error C2065: 'V_0': undeclared identifier
D:\Projects\Unity\THYG\Library\Bee\artifacts\WinPlayerBuildProgram\il2cppOutput\cpp\Assembly-CSharp1.cpp(19063): error C2065: 'V_0': undeclared identifier
D:\Projects\Unity\THYG\Library\Bee\artifacts\WinPlayerBuildProgram\il2cppOutput\cpp\Assembly-CSharp1.cpp(19063): error C2065: 'HashSet_1_tA1368DD5977A2271895CEEC3D6282C68C9675735': undeclared identifier
D:\Projects\Unity\THYG\Library\Bee\artifacts\WinPlayerBuildProgram\il2cppOutput\cpp\Assembly-CSharp1.cpp(19063): error C2059: syntax error: ')'
D:\Projects\Unity\THYG\Library\Bee\artifacts\WinPlayerBuildProgram\il2cppOutput\cpp\Assembly-CSharp1.cpp(19064): error C2065: 'HashSet_1_tA1368DD5977A2271895CEEC3D6282C68C9675735': undeclared identifier
D:\Projects\Unity\THYG\Library\Bee\artifacts\WinPlayerBuildProgram\il2cppOutput\cpp\Assembly-CSharp1.cpp(19064): error C2065: 'L_2': undeclared identifier
D:\Projects\Unity\THYG\Library\Bee\artifacts\WinPlayerBuildProgram\il2cppOutput\cpp\Assembly-CSharp1.cpp(19064): error C2065: 'V_0': undeclared identifier
D:\Projects\Unity\THYG\Library\Bee\artifacts\WinPlayerBuildProgram\il2cppOutput\cpp\Assembly-CSharp1.cpp(19065): error C2065: 'HashSet_1_tA1368DD5977A2271895CEEC3D6282C68C9675735': undeclared identifier
D:\Projects\Unity\THYG\Library\Bee\artifacts\WinPlayerBuildProgram\il2cppOutput\cpp\Assembly-CSharp1.cpp(19065): error C2059: syntax error: ')'
D:\Projects\Unity\THYG\Library\Bee\artifacts\WinPlayerBuildProgram\il2cppOutput\cpp\Assembly-CSharp1.cpp(19066): error C2065: 'HashSet_1_tA1368DD5977A2271895CEEC3D6282C68C9675735': undeclared identifier
D:\Projects\Unity\THYG\Library\Bee\artifacts\WinPlayerBuildProgram\il2cppOutput\cpp\Assembly-CSharp1.cpp(19066): error C2059: syntax error: ')'
D:\Projects\Unity\THYG\Library\Bee\artifacts\WinPlayerBuildProgram\il2cppOutput\cpp\Assembly-CSharp1.cpp(19331): error C3477: a lambda can only appear in an unevaluated context with '/std:c++20' or later
D:\Projects\Unity\THYG\Library\Bee\artifacts\WinPlayerBuildProgram\il2cppOutput\cpp\Assembly-CSharp1.cpp(19428): error C3477: a lambda can only appear in an unevaluated context with '/std:c++20' or later
D:\Projects\Unity\THYG\Library\Bee\artifacts\WinPlayerBuildProgram\il2cppOutput\cpp\Assembly-CSharp1.cpp(20748): error C3477: a lambda can only appear in an unevaluated context with '/std:c++20' or later
D:\Projects\Unity\THYG\Library\Bee\artifacts\WinPlayerBuildProgram\il2cppOutput\cpp\Assembly-CSharp1.cpp(21133): error C3477: a lambda can only appear in an unevaluated context with '/std:c++20' or later
UnityEditor.GenericMenu:CatchMenu (object,string[],int)

Ok it is not that script. It is one of the functions in my code that uses that class as an out parameter. The C# function looks like this:

[Server]
public bool GetBattleUnitWithTag(
            BattleUnitRelationTag tag,
            out FixedSizeLinkedList<BattleUnit> lst
)
{
            //businesslogic...
}

The [Server] attribute (which comes from Mirror Networking plugin) when used with a function having out parameter seems to confuse IL2CPP.

I digged through the generated cpp code and found that IL2CPP decides that there are two FixedSizeLinkedList<T> types (one is called FixedSizeLinkedList_1_t3EAA698F222717A950BC3D871BB65D51F83F6B70 another similarly looking type that starts with FixedSizeLinkedList_1_t) for some reason; hence the syntax complaint on Cpp side.

Refactor the code to not using out parameter, OR simply removing the [Server] attribute (it is not essential for functionalities in my case) resolves the issue.

FYI This is fixed today.
https://github.com/MirrorNetworking/Mirror/issues/3482