locked
CRM 2013 on premises - replacing a third party DLL RRS feed

  • Question

  • Hello,

    I had a problem that induced me into a modification of a third party DLL (Microsoft.Exchange.WebServices.dll) coming from an open source github project. I modified the code and try to re-apply to CRM system. It did not worked as CRM is checking the strong notation key and did not retrieved the expected token. 

    Is it a way to work around and let CRM know about the replaced DLL ? so that does not try to make the verification ?

    Any idea would be highly appreciated.

    Thank you,

    Sever

    Tuesday, November 24, 2015 6:36 AM

Answers

  • Hi Sever,

    I share your pain, I really do. The best (only) way of getting things like this updated is to create a request on Connect and then sacrifice a goat and hope that someone at Microsoft sees you post and find it relevant. (getting people to upvote the request helps, sometimes)

    It's frustrating at times.

    Regards


    Rickard Norström Developer CRM-Konsulterna
    http://www.crmkonsulterna.se
    Swedish Dynamics CRM Forum: http://www.crmforum.se
    My Blog: http://rickardnorstrom.blogspot.se

    • Marked as answer by severs29 Tuesday, November 24, 2015 11:37 AM
    Tuesday, November 24, 2015 11:23 AM

All replies

  • Hi,

    I don't Think you can. If it's a third party DLL, shouldn't you be able to remove it and re-aply your version? It looks sort of shady to fiddle in a Microsoft.* DLL though.

    Regards


    Rickard Norström Developer CRM-Konsulterna
    http://www.crmkonsulterna.se
    Swedish Dynamics CRM Forum: http://www.crmforum.se
    My Blog: http://rickardnorstrom.blogspot.se

    Tuesday, November 24, 2015 6:58 AM
  • Hi Rickard,

    Not sure to call it third-party but that DLL is on a github in opensource status ...

    Just want to be able to replace that for an extremely simple reason:

    I want to force "send email" function to execute a "save" in "Sent Items" before sending the item (message).

    Do you find this shady ?

    Well, my business requests that (as shady as it looks :) and works on Mac's (that's why needed server-sync) and uses different mobile clients also ... Riva is not a viable solution so ...

    Do you have any idea what would be your solution to see emails sent from CRM in Outlook -"Sent Items" folder - using server-side sync ??

    Thanks for your time.

    Regards,

    Sever

    Tuesday, November 24, 2015 9:41 AM
  • Hi Sever,

    I'm not an Exchange expert (either) so i can't really help you on that part. That being said, isn't emails sent using server side sync for account X stored in the sent folder when you send an email from CRM using account X as sender? Where do you use the DLL in the CRM system and how do you apply it? Have you registered it yourself earlier? Can you remove it and re-register it so that the CRM doesn't know about the previous key?

    I don't have access to my lab Environment atm so I can't test how the server side syncs works with sent emails.

    Regards


    Rickard Norström Developer CRM-Konsulterna
    http://www.crmkonsulterna.se
    Swedish Dynamics CRM Forum: http://www.crmforum.se
    My Blog: http://rickardnorstrom.blogspot.se

    Tuesday, November 24, 2015 9:58 AM
  • Hi Rickard,

    Very kind of you to reply.

    My reply: this library is part of Dynamics CRM but they open it for open source development on github...

    its part of Microsoft Exchange Web Services.

    My intention would have been to compensate a function that in core-CRM is not entirely flexible (and as a consequence does not save sent messages in "Sent Items" of Outlook and force it through this library to save the message ... which I proved possible using in an ad-hoc application that I created ...

    Now speaking of de-register and re-register with the modified dll ... I am not sure that this might be allowed functionally by CRM ... meaning not sure how much tight-in is this dll in CRM so that we can make an "upgrade" of it without that the system is error-ing...

    Practically this would be my question "can I do this de-register / re-register - without that CRM is producing errors" ?

    Probably that might be a more valid formulation ... as known from teachers: "a problem well-expressed is half-way solved" ... however this other half I still need it ...

    Thank you Rickard,

    Sever

    Tuesday, November 24, 2015 10:24 AM
  • Hi Sever,

    If it's a part of CRM, then no, you can't de-register it and you shouldn't be able to update it either.

    Just out of curiosity, how would changing the DLL in CRM change how the Exchange server consumes the message? The web service should be available on the receiving end, shouldn't it?

    Regards


    Rickard Norström Developer CRM-Konsulterna
    http://www.crmkonsulterna.se
    Swedish Dynamics CRM Forum: http://www.crmforum.se
    My Blog: http://rickardnorstrom.blogspot.se

    Tuesday, November 24, 2015 10:30 AM
  • If the open source project does not include the key (.snk file) used to sign the original assembly, then you will not be able to replace the original assembly. This is an anti-tampering mechanism build into the .Net framework. I'd be very surprised if Microsoft did provide the signing key, so I expect they only intend for any updated assemblies to be only called from your own code

    Microsoft CRM MVP - http://mscrmuk.blogspot.com/ http://www.excitation.co.uk

    Tuesday, November 24, 2015 10:32 AM
    Moderator
  • The library is Microsoft Copyright but with MIT License.

    Plus its updates 2.2.0 they are not distributed through CRM updates ... maybe the cycle it's different - no complain.

    However using that I can enforce that any call to a send message is translated into a "send and save" of the message.

    So simply said in CRM code the function for "send and save" cannot be accessed.

    Just the "save" one. Well this can be replaced ...

    Problem is that the new DLL is rejected because of strong name key signature and my modified DLL is not loading at the time of execution.

    Of course I can write some code to do this in parallel on a plugin or on another button (on client-side) calling the right EWS function... but it's frustrating to lose so much time just to "re-write" existent code ...

    And that functionality is really needed.

    Here below is the license from a source file Microsoft.Exchange.WebServices.Data.EmailMessage.cs

    Thank you Rickard !

    Sever 

    /*
     * Exchange Web Services Managed API
     *
     * Copyright (c) Microsoft Corporation
     * All rights reserved.
     *
     * MIT License
     *
     * Permission is hereby granted, free of charge, to any person obtaining a copy of this
     * software and associated documentation files (the "Software"), to deal in the Software
     * without restriction, including without limitation the rights to use, copy, modify, merge,
     * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
     * to whom the Software is furnished to do so, subject to the following conditions:
     *
     * The above copyright notice and this permission notice shall be included in all copies or
     * substantial portions of the Software.
     *
     * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
     * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
     * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
     * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
     * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
     * DEALINGS IN THE SOFTWARE.
     */

    Tuesday, November 24, 2015 11:04 AM
  • The library is Microsoft Copyright but with MIT License.

    Plus its updates 2.2.0 they are not distributed through CRM updates ... maybe the cycle it's different - no complain.

    However using that I can enforce that any call to a send message is translated into a "send and save" of the message.

    So simply said in CRM code the function for "send and save" cannot be accessed.

    Just the "save" one. Well this can be replaced ...

    Problem is that the new DLL is rejected because of strong name key signature and my modified DLL is not loading at the time of execution.

    Of course I can write some code to do this in parallel on a plugin or on another button (on client-side) calling the right EWS function... but it's frustrating to lose so much time just to "re-write" existent code ...

    And that functionality is really needed.

    Here below is the license from a source file Microsoft.Exchange.WebServices.Data.EmailMessage.cs

    Thank you Rickard !

    Sever 

    /*
     * Exchange Web Services Managed API
     *
     * Copyright (c) Microsoft Corporation
     * All rights reserved.
     *
     * MIT License
     *
     * Permission is hereby granted, free of charge, to any person obtaining a copy of this
     * software and associated documentation files (the "Software"), to deal in the Software
     * without restriction, including without limitation the rights to use, copy, modify, merge,
     * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
     * to whom the Software is furnished to do so, subject to the following conditions:
     *
     * The above copyright notice and this permission notice shall be included in all copies or
     * substantial portions of the Software.
     *
     * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
     * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
     * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
     * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
     * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
     * DEALINGS IN THE SOFTWARE.
     */
    Tuesday, November 24, 2015 11:05 AM
  • Hi Sever,

    As David said, it's part of the .NET framework, besides if you were able to replace that DLL, there's nothing saying that it wouldn't be replaced by MS in the next update so, replacing it would be dangerous too.

    I'm still sort of confused to why a message isn't stored in the user's sent mail folder. If I write a program that uses our lab Exchange to send an email, that email is stored in the sent folder, the same should happen when you server side sync a send of email IMHO.

    Regards


    Rickard Norström Developer CRM-Konsulterna
    http://www.crmkonsulterna.se
    Swedish Dynamics CRM Forum: http://www.crmforum.se
    My Blog: http://rickardnorstrom.blogspot.se

    Tuesday, November 24, 2015 11:11 AM
  • Thank you for reply David... I know you are aware of my thread from a precedent one ... make sense what you said .... there is no key in the project, however, why should i build my own code to try replicating MS-code just for superseding a method ?! ... Don't you think that a parameter over there (SEND or SENDANDSAVE) would have really been a more valid Microsoft solution ? user-oriented ? ... or if they know there may "un-perfect" world ... why not help and put brakes on the "updateble" solution ?! Don't want to be to rhetoric, but it's sad !

    All because on SEND button of email form it's just:

        sendParams.sendType = "send";
        Mscrm.RefreshPageCommandHandler.executeCommand(Mscrm.InlineCommands.EmailSend, sendParams)

    there's no sendandsave parameter allowed.

    Or if it is please let me know !?

    Meanwhile in EWS lib. we have both functions ... and even more you can even specify in what folder to save...

    Just wanted to use that EWS availability.

    Thanks !

    Sever

    Tuesday, November 24, 2015 11:16 AM
  • Hi Sever,

    I share your pain, I really do. The best (only) way of getting things like this updated is to create a request on Connect and then sacrifice a goat and hope that someone at Microsoft sees you post and find it relevant. (getting people to upvote the request helps, sometimes)

    It's frustrating at times.

    Regards


    Rickard Norström Developer CRM-Konsulterna
    http://www.crmkonsulterna.se
    Swedish Dynamics CRM Forum: http://www.crmforum.se
    My Blog: http://rickardnorstrom.blogspot.se

    • Marked as answer by severs29 Tuesday, November 24, 2015 11:37 AM
    Tuesday, November 24, 2015 11:23 AM
  • Thank you for understanding, if i'll have time i'll do as you adviced !

    Have a great day !

    regards,

    sever

    Tuesday, November 24, 2015 11:39 AM
  • If you post it on Connect, provide a link here, it might get some additional votes, you will have mine at least

    Regards


    Rickard Norström Developer CRM-Konsulterna
    http://www.crmkonsulterna.se
    Swedish Dynamics CRM Forum: http://www.crmforum.se
    My Blog: http://rickardnorstrom.blogspot.se

    Tuesday, November 24, 2015 11:41 AM