Skip to content

Fixing build for src/shims/manual to use appropriate configurations #29206

@Anipik

Description

@Anipik

The build for manual shims against netcoreappaot is currently broken. This is due to the fact that some of projects use a different version of System.Private.CoreLib.
We can add netcoreappaot in all those projects but we have to verify that this is not interfering with other msbuild properties and items being defined.
The error can be reproduced by running build.cmd -f netcoreappaot

Build FAILED.

C:\git\corefx\artifacts\obj\mscorlib\netcoreappaot-Debug\mscorlib.Forwards.cs(1073,93): error CS0012: The type 'Enum' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e'. [C:\git\corefx\src\shims\manual\mscorlib.csproj]
C:\git\corefx\artifacts\obj\mscorlib\netcoreappaot-Debug\mscorlib.Forwards.cs(1073,12): error CS0012: The type 'Enum' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e'. [C:\git\corefx\src\shims\manual\mscorlib.csproj]
    0 Warning(s)
    2 Error(s)

Time Elapsed 00:03:27.72

The newGenfacades bring forward a lot of issues with manual facades. Some of them were handled in dotnet/corefx#36126 but in a little hacky way.

Manual shims have a dependency on System.Private.CoreLib as it uses some public types which are not exposed in the reference assembly.
me and @ericstj tried aliasing these types and removing the reference to System.Private.CoreLib while generating facades but the compiler doesn't allow aliasing of SPC

We require a new approach to handle these manual shims

@ericstj feel free to edit the description.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions