locked
CSOM ILMerge RRS feed

  • Question

  • Hello,

    Has anyone tried to ILMerge Microsoft.SharePoint.Client.dll (especially from Microsoft.SharePointOnline.CSOM, it is for SharePoint Online) and successfully run?

    When I run it in console app I always get exception when clientContext.ExecuteQuery(); being executed.

    System.InvalidCastException: 'Unable to cast object of type 'System.Collections.Generic.Dictionary`2[System.String,System.Object]' to type 'Microsoft.SharePoint.Client.ChangeToken'.'

    Without ILMerge code works fine.

    Friday, July 14, 2017 2:21 PM

All replies

  • Hi,

    Did you use the latest version of the Microsoft.SharePointOnline.CSOM?

    https://www.nuget.org/packages/Microsoft.SharePointOnline.CSOM

    Please check the version of your .NET Framework, try to set the target framework to .NET Framework 4.5 in your console application.

    The "ILMerge" code is from here? https://github.com/Microsoft/ILMerge

    I suggest provide more details about how to reproduce this issue, others would get easier to research on it.

    Best Regards,

    Dennis


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com


    • Edited by Dennis Guo Monday, July 17, 2017 6:34 AM
    Monday, July 17, 2017 6:33 AM
  • Yes, I am using Microsoft.SharePointOnline.CSOM version 16.1.6621.1200 from 30 june of 2017. Version of framework is set to 4.5.2 

    ILMerge from that package

    I will try to upload the vs solution later

    Wednesday, July 19, 2017 11:12 AM
  • Hi,

    Which version of the Visual Studio did you use? Visual Studio 2013?

    Best Regards,

    Dennis


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    Thursday, July 20, 2017 1:25 AM
  • VS 2017 Last update
    Monday, July 24, 2017 10:43 AM
  • Hi,

    The issue seems Microsoft.SharePointOnline.CSOM and MSBuild.ILMerge.Task are not compatibility.

    As a workaround, please uninstall the Microsoft.SharePointOnline.CSOM and download SharePoint Online Client Components SDK from here:

    https://www.microsoft.com/en-us/download/details.aspx?id=42038

    Install it and add Microsoft.SharePoint.Client.dll and Microsoft.SharePoint.Client.Runtime.dll into References in your project.

    The dlls in the location (C:\Program Files\Common Files\microsoft shared\Web Server Extensions\16\ISAPI).

    Best Regards,

    Dennis


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    Wednesday, July 26, 2017 3:00 AM
  • Thanks Denis,

    Will give it a try

    Friday, August 4, 2017 10:22 AM