-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Closed
Labels
Milestone
Description
Description
If you compile application with custom runtime where System.AppContext class is not defined, compiler crash
System.AggregateException: One or more errors occurred. (Code generation failed for method '[S.P.CompilerGenerated]Internal.CompilerGenerated.<Module>.SetAppContextSwitches()')
---> ILCompiler.CodeGenerationFailedException: Code generation failed for method '[S.P.CompilerGenerated]Internal.CompilerGenerated.<Module>.SetAppContextSwitches()'
---> System.InvalidOperationException: Expected type 'System.AppContext' not found in module 'SeeSharpSnake'
Even if I apply suggestion from #63862 (comment) to the csproj file due to this line
| <IlcArg Include="--appcontextswitch:RUNTIME_IDENTIFIER=$(RuntimeIdentifier)" /> |
workaround no longer working.
Reproduction Steps
Close code from this PR MichalStrehovsky/SeeSharpSnake#24
Apply #63862 (comment)
Expected behavior
Custom runtimes can be built using NativeAOT
Actual behavior
Currently it is blocked.
Regression?
No response
Known Workarounds
No response
Configuration
No response
Other information
No response
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
No status