-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Don't reference netstandard1.x packages #74199
Conversation
... when building from source. This was the only remaining project in roslyn that brought them in.
@ViktorHofer source build is failing |
@MichalStrehovsky just to double check, |
Yeah, I don't think the System.Runtime.Loader would do anything good on netfx. Cc @dotnet/appmodel |
What makes this problematic is that Microsoft.CodeAnalysis.Scripting dynamically instantiates either an AssemblyLoadContext or an AssemblyLoader:
|
cc @jaredpar @MichaelSimons @ericstj The goal is to remove all netstandard1.x package dependencies when building from source (see dotnet/source-build#4482). Roslyn is one of the few remaining repos that bring a netstandard1.x package in. For roslyn it's only a single reference in a single place: See my comments above. It's hard to get rid off that package as roslyn dynamically instantiates either an ALC or AssemblyLoader. |
@tmat, @arkalyanms FYI |
As a workaround you could |
Yes, I considered that. The goal here is to remove all netstandard1.x packages. If we keep the System.Runtime.Loader reference then we would need to continue building it in SBRP including its dependencies. |
The compiler approaches this by representing assembly loading through an interface at the That model was designed into the compiler very early on though. Not sure if the scripting layer can take this approach or not. |
@tmat can you please take a look? We need to stop referencing netstandard1.x packages directly as those will eventually be marked as deprecated and together with NuGet's new Audit mode, such package references will result in errors. |
@arkalyanms / @jaredpar can you please help me find someone to take a look at this? I will be out for an extended time starting in about two weeks and would ideally want to complete this by then. |
What are you looking for feedback on? Is the PR as written not meeting the goal here of removing |
The changes in this PR aren't complete as when building from source, the I'm trying to understand how to avoid the package reference entirely and if such a change would be acceptable. As mentioned above, this will help the regular (msft) build and source-build as we will eventually deprecate these packages. |
Scripting uses reflection light-up. If the app that loads the library runs on .NET Framework we use desktop AssemblyLoader via reflection. If it runs on .NET Core we use ALC (directly - hence the reference to System.Runtime.Loader). The project is now multi-targeting so I think we can use |
Searching through the dotnet GH org I found a few projects that currently target .NET Standard and rely on the "Microsoft.CodeAnalysis.Scripting.Common" package.
If we remove the netstandard2.0 TFM, then we would also need to at least update these projects.
That sounds right to me. @tmat can you help with that? |
Working on it. |
PR ready: #74409 |
Closing in favor of #74409 |
... when building from source.
This was the only remaining project in roslyn that brought them in.
Contributes to dotnet/source-build#4482