-
Notifications
You must be signed in to change notification settings - Fork 512
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[msbuild][mac][ios] Fix referencing netstandard projects (#2643)
Building a XI or XM (Modern) project that references a netstandard 2.0 project with msbuild fails because of a missing reference to `netstandard.dll`. AppDelegate.cs(21,52): error CS0012: The type 'Object' is defined in an assembly that is not referenced. You must add a reference to assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. The reason is that XI and XM (Modern) projects have `$(TargetFrameworkIdentifier) != .NETFramework`, so targets from `Microsoft.NET.Build.Extensions` which provide ns2.0 support don't get imported. `ImplicitlyExpandNETStandardFacades` in particular, which would have added a reference to `netstandard.dll`. `netstandard.dll` gets included as part of the facades expanded by `ImplicitlyExpandDesignTimeFacades`, but this gets skipped if the project does not have a `System.Runtime` dependent reference. Instead, we want to expand the facades if any reference depends on `System.Runtime` OR `netstandard`. And for that we scan all the references for a `netstandard` dependency using the `GetDependsOnNETStandard` task. Partially fixes bxc #58504 .
- Loading branch information
Showing
2 changed files
with
60 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters