Skip to content

Building libraries in pre netstandard-2.0 configurations #1919

Closed

Description

@marek-safar

When building libraries in pre-netstandard-2.0 configurations for example netstandard1.3

./build.sh --build -subsetCategory libraries -framework netstandard1.3 -os Windows_NT

the build fails with following build error (it still builds 2.0 configuration)

  System.IO.FileSystem.AccessControl -> /runtime-checkout/artifacts/bin/System.IO.FileSystem.AccessControl/ref/netstandard2.0-Debug/System.IO.FileSystem.AccessControl.dll
  System.Reflection.Emit -> /runtime-checkout/artifacts/bin/System.Reflection.Emit/ref/netstandard2.0-Debug/System.Reflection.Emit.dll
  System.DirectoryServices -> /runtime-checkout/artifacts/bin/System.DirectoryServices/ref/netstandard2.0-Debug/System.DirectoryServices.dll
  System.ServiceProcess.ServiceController -> /runtime-checkout/artifacts/bin/System.ServiceProcess.ServiceController/ref/netstandard2.0-Debug/System.ServiceProcess.ServiceController.dll
  System.Data.OleDb -> /runtime-checkout/artifacts/bin/System.Data.OleDb/ref/netstandard2.0-Debug/System.Data.OleDb.dll
  Restore completed in 27.97 ms for /runtime-checkout/src/libraries/restore/winrt/winrt.depproj.
  /Users/marek/.nuget/packages/microsoft.targetingpack.private.winrt/1.0.5/lib/netstandard1.0/Windows.winmd (Microsoft.TargetingPack.Private.WinRT.1.0.5) -> /runtime-checkout/artifacts/bin/winrt/netstandard1.0-Debug/Windows.winmd
  System.Runtime.WindowsRuntime -> /runtime-checkout/artifacts/bin/System.Runtime.WindowsRuntime/ref/netstandard2.0-Debug/System.Runtime.WindowsRuntime.dll
  System.Runtime.WindowsRuntime.UI.Xaml -> /runtime-checkout/artifacts/bin/System.Runtime.WindowsRuntime.UI.Xaml/ref/netstandard2.0-Debug/System.Runtime.WindowsRuntime.UI.Xaml.dll
/runtime-checkout/.dotnet/sdk/5.0.100-alpha1-015772/Microsoft.Common.CurrentVersion.targets(2081,5): error MSB3245: Could not resolve this reference. Could not locate the assembly "System.Runtime". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. [/runtime-checkout/src/libraries/mscorlib.WinRT-Facade/ref/mscorlib.WinRT-Facade.csproj]
/runtime-checkout/.dotnet/sdk/5.0.100-alpha1-015772/Microsoft.Common.CurrentVersion.targets(2081,5): error MSB3245: Could not resolve this reference. Could not locate the assembly "System.Runtime". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. [/runtime-checkout/src/libraries/System.Runtime.CompilerServices.Unsafe/ref/System.Runtime.CompilerServices.Unsafe.csproj]

Note: this builds successfully but still builds some 2.1 artefacts

./build.sh --build -subsetCategory libraries -framework netstandard2.0 -os Windows_NT

Activity

  1. added
    untriaged
    on Jan 19, 2020
  2. ViktorHofer commented on Feb 12, 2020

    @ViktorHofer
    Member
  3. Anipik commented on Feb 12, 2020

    @Anipik
    Contributor

    this builds successfully but still builds some 2.1 artefacts

    That is expected becuase we always build our ref libraries for netstandard2.0 and netstandard2.1
    you can disable that by setting AdditionalBuildTargetFrameworks to empty.

    i think there is no harm in building it, but we can add some conditions to additionalbuildTargetFrameworks to not build if vertical build version is higher. @ViktorHofer ur thoughts ?

  4. ViktorHofer commented on Feb 13, 2020

    @ViktorHofer
    Member

    @marek-safar did you try add --restore to the arguments? It could be the case that you just haven't had restored for the older netstandard configurations, hence the references can't be resolved and RAR complains.

  5. ViktorHofer commented on Feb 13, 2020

    @ViktorHofer
    Member

    Ideally we would always build all configurations during the build. I would hesitate stepping into the opposite direction.

  6. marek-safar commented on Feb 13, 2020

    @marek-safar
    ContributorAuthor

    I think I run --restore but would have to try again to be sure. I'd expect when we have the --framework option which says "Build framework X" that it builds only that framework not that it builds also some unnecessary stuff because we could not figure out correct dependency chain.

  7. ViktorHofer commented on Feb 13, 2020

    @ViktorHofer
    Member

    That's right, if the framework is passed in that only that one should be build except for netstandard2.0 and netstandard2.1 as we depend on refs for those on netcoreapp builds.

    My statement was about the default build which should build all frameworks/configuration if no option is specified. We aren't there yet as that would slow down the default build too much but we wanna get there.

  8. marek-safar commented on Feb 13, 2020

    @marek-safar
    ContributorAuthor

    We aren't there yet as that would slow down the default build too much but we wanna get there.

    I don't think that should be the goal and will be very painful with expanding matrix of platforms and I'd argue for exact opposite. Which is by default build only the single configuration if no extra options are used.

  9. ViktorHofer commented on Apr 17, 2020

    @ViktorHofer
    Member

    @Anipik can you please take a look and decide if we work needs to be done here? Thanks

  10. self-assigned this
    on Apr 17, 2020
  11. Anipik commented on Apr 17, 2020

    @Anipik
    Contributor

    i will take a look

  12. removed
    untriaged
    on Jul 8, 2020
  13. ViktorHofer commented on Jul 8, 2020

    @ViktorHofer
    Member

    Submitted #38936 which fixes the building to much issue and #35606 will fix the top issue.

  14. added this to the 5.0.0 milestone on Jul 8, 2020
  15. ghost locked as resolved and limited conversation to collaborators on Dec 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions