Closed Jaafar-abusair closed 2 years ago
I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.
@Jaafar-abusair I think this is a similar issue to https://github.com/dotnet/runtime/issues/74380.
See Microsoft.AspNetCore.Authentication, Version=6.0.0.0
and microsoft.dotnet.ilcompiler\7.0.0-preview.4.22229.4
. Mixing 6 and 7 seem to be not supported.
/cc @MichalStrehovsky
This is just the RD.XML parser telling you in a very user-unfriendly way that the type IAuthenticationService doesn't exist in Microsoft.AspNetCore.Authentication. It's probably in a different assembly. #64869 tracks fixing the experience. It's in Future milestone because we don't plan to officially document RD.XML anywhere. Latest builds no longer have the fwlink pointing to those docs.
I have switched to ILCompiler 6, but the problem still there, I think it's because the IdentityServer4 is using Microsoft.AspNetCore.Authentication 2.2.0
is IdentityServer4 supported by native build?
The RD.XML was the correct approach, but you specified the wrong assembly - that's why it wasn't compiling.
@MichalStrehovsky can you guide me to the correct assembly?
IAuthenticationService
lives in Microsoft.AspNetCore.Authentication.Abstractions
I found it by searching aspnetcore repo: https://github.com/dotnet/aspnetcore/blob/main/src/Http/Authentication.Abstractions/src/IAuthenticationService.cs
@jkotas yes, but the name space still "Microsoft.AspNetCore.Authentication", I think the problem related to assembly version, how to tell RD.XML file to load specific version?
Versions do not matter in rd.xml. The aot compiler always loads the one and only version that the application was published with.
I'm trying to build application using ILComplier with IdentityServer4 package, when I run the application I got the following error when running the application after the build .. 'IdentityServer4.Configuration.DependencyInjection.Decorator<Microsoft.AspNetCore.Authentication.IAuthenticationService,Microsoft.AspNetCore.Authentication.AuthenticationService>' is missing metadata. For more information, please visit http://go.microsoft.com/fwlink/?LinkID=392859 .. using Net 7 used rd.xml reference: PackageReference Include="AspNetCore.Identity.MongoDbCore" Version="3.1.2" /> PackageReference Include="IdentityServer4" Version="4.1.2" /> PackageReference Include="IdentityServer4.AccessTokenValidation" Version="3.0.1" /> PackageReference Include="IdentityServer4.AspNetIdentity" Version="4.1.2" /> PackageReference Include="Microsoft.AspNetCore.Authentication" Version="2.2.0" /> PackageReference Include="Microsoft.AspNetCore.Authentication.Abstractions" Version="2.2.0" /> PackageReference Include="Microsoft.AspNetCore.Authentication.Core" Version="2.2.0" /> PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="6.0.8" /> PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="6.0.8" /> PackageReference Include="Newtonsoft.Json" Version="13.0.1" /> PackageReference Include="Swashbuckle.AspNetCore" Version="6.2.3" />
Could you help me? michealdanida@gmail.com
Description
Hi,
I'm trying to build application using ILComplier with IdentityServer4 package, when I run the application I got the following error when i run the application after the build
I tried to add the following to rd.xml, and I got another error on build this time
Error:
Reproduction Steps
<TargetFramework>net6.0</TargetFramework>
packages\identityserver4\4.1.2 packages\microsoft.aspnetcore.authentication\2.2.0publish command dotnet publish [projectname] -c Release -r win-x64
Expected behavior
The app get build and run
Actual behavior
before updating the rd.xml, it get build and error on run time after updating the rd.xml, the error on build
Regression?
No response
Known Workarounds
No response
Configuration
No response
Other information
No response