You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Expected being able to use System.Memory library while having Microsoft.IdentityModel.Protocols.OpenIdConnect referenced in a class library project.
Actual behavior
Throws an System.IO.FileLoadException : Could not load file or assembly 'System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1
Possible solution
This seems only to be an issue for class libraries. If your project is Executable this does not seems to an issue. Workaround for class libraries is using the 'Microsoft.NET.Test.Sdk' library as this seems to fix the issue.
From my limited understanding is, that there is an event-handler in both the library 'Microsoft.NET.Test.Sdk' and the executable project. That looks up the GAC, to resolve the FileLoadException.
Additional context / logs / screenshots / links to code
The issue seems to be introduced for Microsoft.IdentityModel.Protocols.OpenIdConnect at version 6.23.0.
Here is a picture of a test project, which hits this issue.
The text was updated successfully, but these errors were encountered:
HamzaBA26
changed the title
[Bug]
FileLoadException for System.Runtime.CompilerServices.Unsafe, when using System.memory
Apr 19, 2024
Which version of Microsoft.IdentityModel are you using?
Note that to get help, you need to run the latest version.
Where is the issue?
Issue found in Microsoft.IdentityModel.Protocols.OpenIdConnect 7.5.1
Is this a new or an existing app?
This is found in development, as we were upgrading Microsoft.IdentityModel.Protocols.OpenIdConnect to latest version, our tests ran into this issue.
Repro
Expected behavior
Expected being able to use System.Memory library while having Microsoft.IdentityModel.Protocols.OpenIdConnect referenced in a class library project.
Actual behavior
Throws an System.IO.FileLoadException : Could not load file or assembly 'System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1
Possible solution
This seems only to be an issue for class libraries. If your project is Executable this does not seems to an issue. Workaround for class libraries is using the 'Microsoft.NET.Test.Sdk' library as this seems to fix the issue.
From my limited understanding is, that there is an event-handler in both the library 'Microsoft.NET.Test.Sdk' and the executable project. That looks up the GAC, to resolve the FileLoadException.
Additional context / logs / screenshots / links to code
The issue seems to be introduced for Microsoft.IdentityModel.Protocols.OpenIdConnect at version 6.23.0.
Here is a picture of a test project, which hits this issue.
The text was updated successfully, but these errors were encountered: