Notifications
Announcements
No record found.
Hi Experts
I had been doing some integration wherein I wrote C# code (.NET Framework 4.7.2) and had used nuget package to install package related to "System.IdentityModel.Tokens.Jwt.JwtPayload" and I'm able to get the desired result in C#, Now the real issues start appearing when I added a reference of this dll to my D365 Finance. I didnt get any build issues however when I ran the specific process related to this custom dll - it threw the following 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'.
From what I can tell from your description. I guess you will have to add all the dependencies (DLLs etc.) of your custom DLL to the bin folder of your model.
Hi Rahul,
Have you checked if the same dll, probably an older version, is used by the standard Dynamics 365 Finance application? In that case, you can't use a later version as the Dynamics 365 application will have its own version initiated.
Yes, I did add all my custom dll's but still it throws the error.
yes, it does exists in the standard folders too with lower version.
But my understanding was if I add custom with 4.7.2 version, it's going to overwrite - is that not the case?
Please let me know the alternative or possible solution?
No, the standard one won't be overwritten. Can't you simply use the version that is used by F&O?
By the way, 4.7.2 likely isn't the assembly version. I think you're talking about the target version of .NET Framework, which is a different thing.
Yes, I did find one at this location (K:\AosService\PackagesLocalDirectory\bin) --> System.IdentityModel.Tokens.Jwt
and when I wrote program in C#, I added the package via Nuget.
I'm not sure whether I can use the d365 Finance dll for it as I'm using jwtPayload, JwtHeader, Token, etc
Please help. thank you!
I just noticed the standard library doesn't have few methods that may be needed for generating token
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'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:
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?
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
André Arnaud de Cal... 449 Super User 2025 Season 2
Martin Dráb 422 Most Valuable Professional
BillurSamdancioglu 239 Most Valuable Professional