My suggestion is not trying to add a different version of the assembly, because it won't work. Use the one that is used by F&O. And consider if doing the work in X++ is the right approach. I can't comment on it, because I don't know what you're implementing.
Okay, do you have any idea why this error popping up? (Or) how we can resolve it?
No, it doesn't mean that methods aren't there. The assembly can't be loaded, therefore the system can't know which methods are or aren't there. The error means that either no such assembly was found or it can't be loaded for some reason.
The version from the error message is the requested version from a reference, not the version of the file.
yes it says 'couldnt load' - does that not mean those methods are not there in standard. btw, it shows same version in my system too however the error says version 4.0.0.0.
Any idea how can I resolve it?
In my case, F&O uses 4.0.10819.1000, i.e. a higher version than mentioned in your error message.
Okay, so it has nothing to do with "I just noticed the standard library doesn't have few methods that may be needed for generating token" and this statement should be ignored, right? Because the error says that the assembly can't be even loaded.
You said that F&O uses an older version of this assembly. What is the version number?
I'm trying to generate the JWT token by supplying Private key, and other parameters for which I had to use "System.IdentityModel.Tokens.Jwt" and bouncy castle dll's in my C# library.
finally, I'm trying referencing the solution dll to my D365 FO solution to perform integration.
I didn't get any build/sync issues however when I ran the process from front end. it throws the below error:
Could not load type 'System.IdentityModel.Tokens.Jwt.JwtPayload' from assembly 'System.IdentityModel.Tokens.Jwt, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
The error doesn't match your description. It says that the assembly couldn't be loaded, not that it was loaded but it missed some methods you wanted. Maybe you pasted a wrong error by mistake. If so, give us the correct information and then we might be able to tell you how to achieve your goal with the older version (although a .NET forum would be more appropriate for that).
Also, if you explain your business requirement to us, we may be able to suggest an alternative design.
I just noticed the standard library doesn't have few methods that may be needed for generating token
Could not load type 'System.IdentityModel.Tokens.Jwt.JwtPayload' from assembly 'System.IdentityModel.Tokens.Jwt, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
André Arnaud de Cal... 291,791 Super User 2024 Season 2
Martin Dráb 230,488 Most Valuable Professional
nmaenpaa 101,156