Skip to main content

Notifications

Announcements

No record found.

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! :) 
  • Issues with the DLL(D365 Finance out of box with same name custom solution dll)
    Did you find an answer? I'm getting the same error.
  • Martin Dráb Profile Picture
    Martin Dráb 230,488 Most Valuable Professional on at
    RE: Issues with the DLL(D365 Finance out of box with same name custom solution dll)

    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.

  • RahulD365 Profile Picture
    RahulD365 85 on at
    RE: Issues with the DLL(D365 Finance out of box with same name custom solution dll)

    Okay, do you have any idea why this error popping up? (Or) how we can resolve it?

  • Martin Dráb Profile Picture
    Martin Dráb 230,488 Most Valuable Professional on at
    RE: Issues with the DLL(D365 Finance out of box with same name custom solution dll)

    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.

  • RahulD365 Profile Picture
    RahulD365 85 on at
    RE: Issues with the DLL(D365 Finance out of box with same name custom solution dll)

    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?

  • Martin Dráb Profile Picture
    Martin Dráb 230,488 Most Valuable Professional on at
    RE: Issues with the DLL(D365 Finance out of box with same name custom solution dll)

    In my case, F&O uses 4.0.10819.1000, i.e. a higher version than mentioned in your error message.

  • Martin Dráb Profile Picture
    Martin Dráb 230,488 Most Valuable Professional on at
    RE: Issues with the DLL(D365 Finance out of box with same name custom solution dll)

    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?

  • RahulD365 Profile Picture
    RahulD365 85 on at
    RE: Issues with the DLL(D365 Finance out of box with same name custom solution dll)

    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
    Martin Dráb 230,488 Most Valuable Professional on at
    RE: Issues with the DLL(D365 Finance out of box with same name custom solution dll)

    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
    RahulD365 85 on at
    RE: Issues with the DLL(D365 Finance out of box with same name custom solution dll)

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

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

Congratulations 2024 Spotlight Honorees

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December

Congratulations to our December super stars! 🥳

Start Your Super User Journey Pt 2

Join the ranks of our community heros! 🦹

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,791 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,488 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans