Microsoft Dynamics CRM 4.0 package plug-ins with multiple DLL files into one DLL for deployment

Source: Internet
Author: User
Tags microsoft dynamics

In plug-in development of Microsoft Dynamics CRM 4.0, third-party DLL is often referenced. If it is deployed on a disk, it will not have a great impact. If it is deployed on a database, the plug-in cannot run because it references a third-party DLL. In my opinion, the plug-in deployment tool only serializes the plug-in DLL to the database, but the third-party DLL is not in it. Is it impossible to deploy plug-ins that reference third-party class libraries in the form of databases?

To solve this problem, I have found two methods:CodeMigrate to the plug-in DLL. Second, use ilmerge to mix multiple DLL files. The first method is obviously unrealistic in some cases, so I will tell you the second method.

First, download the ilmerge tool from Microsoft:

This is: http://www.microsoft.com/downloads/en/details.aspx? Familyid = 22914587-b4ad-4eae-87cf-b14ae6a939b0 & displaylang = en

Use this tool to package plugin into a DLL.

I use one of my test plug-ins as an example:

This plug-in references a third-party class library of LINQ to CRM for query convenience. It has two DLL files: linqtocrm. DLL, the second is stunnware. CRM. fetch. DLL, coupled with my own plug-in DLL, a total of three DLL need to be merged. Note that the Microsoft. CRM. SDK and Microsoft. CRM. sdktypeproxy dll must not be merged.

Next we can use the command prompt to merge the DLL. First we need to go to the installation directory of ilmerge, and then enter the following command:

Note:/Keyfile: this parameter is mandatory for the newly merged DLL. If no plug-in is available, an error is returned.

Here, the three DLL files will be merged into one named mytest. dll, which can be deployed in the database mode, and there is no problem with the disk.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.