简体   繁体   English

与Microsoft.Servicebus.dll的ILMerge for CRM插件

[英]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. 我正在尝试使用ILMerge将Microsoft.Servicebus.dll合并到我的CRM插件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. 不允许使用未解决的程序集引用:Microsoft.Azure.Services.AppAuthentication。

The versions I am using for each dll are listed below in the screenshot. 屏幕截图下方列出了我为每个dll使用的版本。 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. 我不知道为什么会这样,但是如果我将servicebus dll的版本更改为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). (如果这样做,在实际运行CRM插件代码时会出现另一个错误,因此我想使用4.1.7)。

在此处输入图片说明

For anyones info, in the end I didn't merge the servicebus dll in with the plugin code. 对于所有人的信息,最后我没有将servicebus dll与插件代码合并。 I called an Azure Function (via a Webhook using WebClient). 我调用了Azure函数(通过使用WebClient的Webhook)。 The Azure function had the servicebus dll and code instead of my plugin. Azure函数具有servicebus dll和代码,而不是我的插件。 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);
        }
    }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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