简体   繁体   中英

ILMerge with Microsoft.Servicebus.dll for CRM plugin

I am trying to use ILMerge to merge the Microsoft.Servicebus.dll in to my CRM plugin dll. For some reason i keep getting the below error when trying to build my project;

Unresolved assembly reference not allowed: Microsoft.Azure.Services.AppAuthentication.

The versions I am using for each dll are listed below in the screenshot. I have no idea why this is happening but it works if I change the version of the servicebus dll down to 4.1.6. (If I do that, i get another error when actually running the CRM plugin code, so I want to use 4.1.7).

在此处输入图片说明

For anyones info, in the end I didn't merge the servicebus dll in with the plugin code. I called an Azure Function (via a Webhook using WebClient). The Azure function had the servicebus dll and code instead of my plugin. All the plugin ended up doing was calling this function.

        public static void FileCopy(string source, string dest, string webhookurl)
    {
        using (var client = new WebClient { Headers = { [HttpRequestHeader.ContentType] = "application/json" } })
        {
            var paramRecord = new Parameters(source, dest);

            var serializer = new DataContractJsonSerializer(typeof (Parameters));
            var memoryStream = new MemoryStream();
            serializer.WriteObject(memoryStream, paramRecord);

            // todo handle the removal of escaped strings better
            var jsonObject = Encoding.Default.GetString(memoryStream.ToArray()).Replace(@"\", "");

            string response = client.UploadString(webhookurl, jsonObject);
        }
    }

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM