Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove dependency on deprecated ref package #74814

Merged
merged 1 commit into from
Aug 21, 2024
Merged

Conversation

jaredpar
Copy link
Member

This removes our dependency on the deprecated Microsoft.NET.Build.Extensions package. This is used under the hood when building a net461 (or earlier) desktop TFM against netstandard2.0 references. It contains a number of facade assemblies that bridge the gaps in a few places.

There is only one test that dependend on this. I migrated it to a .NET core scenario that should cover the same area.

This removes our dependency on the deprecated Microsoft.NET.Build.Extensions
package. This is used under the hood when building a `net461` (or
earlier) desktop TFM against `netstandard2.0` references. It contains a
number of facade assemblies that bridge the gaps in a few places.

There is only one test that dependend on this. I migrated it to a .NET
core scenario that should cover the same area.
@jaredpar jaredpar requested review from a team as code owners August 19, 2024 22:31
@dotnet-issue-labeler dotnet-issue-labeler bot added Area-Compilers untriaged Issues and PRs which have not yet been triaged by a lead labels Aug 19, 2024

solution = AddProjectWithMetadataReferences(solution, "DesktopProject", LanguageNames.CSharp, @"
solution = AddProjectWithMetadataReferences(solution, "NetCoreProject", LanguageNames.CSharp, @"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This changes the test here from being a net461 project referencing a netstandard2.0 to net8.0 referencing netstandard2.0. That actually matches the original issue closer by my reading. It is still under the hood though verifying that we can map symbols between the two projects when the underlying references substantially change and we have to deal with mapped symbols.

Waiting for @sharwell, @jasonmalinowski or @CyrusNajmabadi to sign off on this or let me know if I missed a subtle issue about this test.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We probably went with testing netstandard and .NET Framework since they'd be most "different" in terms of types being in different assemblies. Is there a reason we can't keep this a .NET Framework ref?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason we can't keep this a .NET Framework ref?

It's difficult to keep the net461 reference because of how the mapping between netstandard2.0 to net461 works under the hood. It effectively downloads / loads a deprecated NuPkg that adds a couple dozen facade assemblies to the build. This is needed because netstandard2.0 was somewhat ret-conned into net461. If there were a lot of tests that did the netstandard -> net461 mapping I'd be inclined to get that all mapped out with basic ref assemblies and use it. But this the only test that does this.

We probably went with testing netstandard and .NET Framework since they'd be most "different" in terms of types being in different assemblies

I assure you they are quite different in netstandard2.0 and any modern .NET core TFM. For example any core primitive type goes from being defined in netstandard.dll to System.Runtime.dll. They are, quite unfortunately, substantially different.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or example any core primitive type goes from being defined in netstandard.dll to System.Runtime.dll

OK that would worry me less here; as long as we have some test that is asserting that we can handle the cases where System.Object comes from different assemblies, we're probably good.

@@ -130,10 +130,6 @@ Add-TargetFramework "SystemThreadingTasksExtensions" '$(PkgSystem_Threading_Task
'NetStandard20Lib#\lib\netstandard2.0\System.Threading.Tasks.Extensions.dll'
)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The grim reaper advances another door.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only three doors left.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Compilers untriaged Issues and PRs which have not yet been triaged by a lead VSCode
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants