web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested Answer

Issues with the DLL(D365 Finance out of box with same name custom solution dll)

(0) ShareShare
ReportReport
Posted on by 85

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'.

can someone please help me get through this problem, or what do I need to perform to resolve the issue. 
thank you! :) 
I have the same question (0)
  • Suggested answer
    Anton Venter Profile Picture
    20,346 Super User 2025 Season 2 on at

    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.

  • André Arnaud de Calavon Profile Picture
    301,171 Super User 2025 Season 2 on at

    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.

  • RahulD365 Profile Picture
    85 on at

    Yes, I did add all my custom dll's but still it throws the error.

  • RahulD365 Profile Picture
    85 on at

    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?

  • Martin Dráb Profile Picture
    237,978 Most Valuable Professional on at

    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.

  • RahulD365 Profile Picture
    85 on at

    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!

  • RahulD365 Profile Picture
    85 on at

    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'.

  • Martin Dráb Profile Picture
    237,978 Most Valuable Professional on at

    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.

  • RahulD365 Profile Picture
    85 on at

    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'.

  • Martin Dráb Profile Picture
    237,978 Most Valuable Professional on at

    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.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 449 Super User 2025 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 422 Most Valuable Professional

#3
BillurSamdancioglu Profile Picture

BillurSamdancioglu 239 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans