Skip to content

Cleanup microsoft-identity-web dependencies #3314

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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

vikukush
Copy link

@vikukush vikukush commented Mar 31, 2025

Cleanup microsoft-identity-web dependencies

Cleanup unnecessary PackageReferences and ProjectReferences from microsoft-identity-web

Description

Use ReferenceTrimmer to clean up unnecessary PackageReferences and ProjectReferences.

Four new AOT warnings excluded, caused by proper .NET SDK functions having these RequiresUnreferencedCodeAttribute and RequiresDynamicCodeAttribute attributes on them. This matches all the other warnings in this file.

D:\VSTS\microsoft-identity-web\src\Microsoft.Identity.Web.DownstreamApi\DownstreamApiExtensions.cs(33): Trim analysis warning IL2026: Microsoft.Identity.Web.DownstreamApiExtensions.AddDownstreamApi(IServiceCollection,String,IConfiguration): Using member 'Microsoft.Extensions.DependencyInjection.OptionsConfigurationServiceCollectionExtensions.Configure<DownstreamApiOptions>(IServiceCollection,String,IConfiguration)' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. TOptions's dependent types may have their members trimmed. Ensure all required members are preserved. [D:\VSTS\microsoft-identity-web\tests\Microsoft.Identity.Web.AotCompatibility.TestApp\Microsoft.Identity.Web.AotCompatibility.TestApp.csproj::TargetFramework=net8.0]
D:\VSTS\microsoft-identity-web\src\Microsoft.Identity.Web.DownstreamApi\DownstreamApiExtensions.cs(33): AOT analysis warning IL3050: Microsoft.Identity.Web.DownstreamApiExtensions.AddDownstreamApi(IServiceCollection,String,IConfiguration): Using member 'Microsoft.Extensions.DependencyInjection.OptionsConfigurationServiceCollectionExtensions.Configure<DownstreamApiOptions>(IServiceCollection,String,IConfiguration)' which has 'RequiresDynamicCodeAttribute' can break functionality when AOT compiling. Binding strongly typed objects to configuration values may require generating dynamic code at runtime. [D:\VSTS\microsoft-identity-web\tests\Microsoft.Identity.Web.AotCompatibility.TestApp\Microsoft.Identity.Web.AotCompatibility.TestApp.csproj::TargetFramework=net8.0]
D:\VSTS\microsoft-identity-web\src\Microsoft.Identity.Web.DownstreamApi\DownstreamApiExtensions.cs(73): Trim analysis warning IL2026: Microsoft.Identity.Web.DownstreamApiExtensions.AddDownstreamApis(IServiceCollection,IConfigurationSection): Using member 'Microsoft.Extensions.Configuration.ConfigurationBinder.Bind(IConfiguration,Object)' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. Cannot statically analyze the type of instance so its members may be trimmed. [D:\VSTS\microsoft-identity-web\tests\Microsoft.Identity.Web.AotCompatibility.TestApp\Microsoft.Identity.Web.AotCompatibility.TestApp.csproj::TargetFramework=net8.0]
D:\VSTS\microsoft-identity-web\src\Microsoft.Identity.Web.DownstreamApi\DownstreamApiExtensions.cs(73): AOT analysis warning IL3050: Microsoft.Identity.Web.DownstreamApiExtensions.AddDownstreamApis(IServiceCollection,IConfigurationSection): Using member 'Microsoft.Extensions.Configuration.ConfigurationBinder.Bind(IConfiguration,Object)' which has 'RequiresDynamicCodeAttribute' can break functionality when AOT compiling. Binding strongly typed objects to configuration values requires generating dynamic code at runtime, for example instantiating generic types. [D:\VSTS\microsoft-identity-web\tests\Microsoft.Identity.Web.AotCompatibility.TestApp\Microsoft.Identity.Web.AotCompatibility.TestApp.csproj::TargetFramework=net8.0]

@vikukush vikukush marked this pull request as ready for review March 31, 2025 19:15
@vikukush vikukush requested a review from a team as a code owner March 31, 2025 19:15
@vikukush
Copy link
Author

vikukush commented Apr 1, 2025

I tried enabling central package management for this repo, but there's just SO MUCH PACKAGE VERSION CONFLICTS, it's not really possible without bumping a lot of dependencies
Microsoft.IdentityModel.Tokens that you use globally as version 8.7.0 already depends on microsoft.extensions 6.0+ and that ruins all those 2.1.0 dependencies you've got there

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant