locked
Use external file with a plugin ? RRS feed

  • Question

  • Hi.

    1 - is that possible to modify or create file/directory on the crm's server by using plugins ?

    2 -  I need to load a file and modify it (by using plugin's methods) before sending it to the user.
    is that possible to do that with a plugin ?
    (load the file from the crm server)

    3 - my plugin will use an external .dll , how can I register this library ?

    thanks.

    Sorry for my english.
    Tuesday, November 17, 2009 8:44 PM

Answers

  • Let me try if I can address your questions.

    1. Technically yes, but it may not be the best practice for a couple reasons. First, it will introduce performance overhead, and also involves file locking. Second, you need to be careful with security setting of the target files, you supposed to grant read/write access to Network Service account which is the application pool account for CRM server.
    2. Ditto. If you are planning to send email in plug-in, you might want to register your plug-in using Asynchronous mode instead of synchronous to avoid performance overhead.
    3. If you need to use external assembly, you should sign it with a strong name key, and deploy to GAC. Another option is to ILMerge tool to merge the external assembly and your own plug-in assembly. So if you don't have the source code of the external assembly, the second approach is probably the only option for you, otherwise, I would go with the first approach.

    Cheers,


    Daniel Cai | http://danielcai.blogspot.com
    • Marked as answer by KrogoDev Wednesday, November 18, 2009 3:43 PM
    Tuesday, November 17, 2009 8:56 PM
  • Hi,

    1) Yes, it is possible if either the crm application pool identity (synchronous plugins) or the async service identity (async plugins )has the appropriate rights
    2) Can you please describe this more detailed? How would you like to send the file?
    3) Either place the reference in the GAC of all CRM servers or use ILMerge and merge it with you plugin assembly
    • Marked as answer by KrogoDev Wednesday, November 18, 2009 3:43 PM
    Tuesday, November 17, 2009 8:56 PM

All replies

  • Let me try if I can address your questions.

    1. Technically yes, but it may not be the best practice for a couple reasons. First, it will introduce performance overhead, and also involves file locking. Second, you need to be careful with security setting of the target files, you supposed to grant read/write access to Network Service account which is the application pool account for CRM server.
    2. Ditto. If you are planning to send email in plug-in, you might want to register your plug-in using Asynchronous mode instead of synchronous to avoid performance overhead.
    3. If you need to use external assembly, you should sign it with a strong name key, and deploy to GAC. Another option is to ILMerge tool to merge the external assembly and your own plug-in assembly. So if you don't have the source code of the external assembly, the second approach is probably the only option for you, otherwise, I would go with the first approach.

    Cheers,


    Daniel Cai | http://danielcai.blogspot.com
    • Marked as answer by KrogoDev Wednesday, November 18, 2009 3:43 PM
    Tuesday, November 17, 2009 8:56 PM
  • Hi,

    1) Yes, it is possible if either the crm application pool identity (synchronous plugins) or the async service identity (async plugins )has the appropriate rights
    2) Can you please describe this more detailed? How would you like to send the file?
    3) Either place the reference in the GAC of all CRM servers or use ILMerge and merge it with you plugin assembly
    • Marked as answer by KrogoDev Wednesday, November 18, 2009 3:43 PM
    Tuesday, November 17, 2009 8:56 PM
  • I just need to create a directory and put in one file and then use it to create all the others file I need...
    (maybe create a temporary file for downloading and then remove it)
    I'm planning to make a form to download the required file modified by plugin's methods
    can you show me wich methods I could use for that ?

    Tuesday, November 17, 2009 9:04 PM
  • Writing to a file in plug-in is basically nothing different from what you will do in any other C# project. Refer to this MSDN arcticle for how to do it using C#.

    Cheers,


    Daniel Cai | http://danielcai.blogspot.com
    Tuesday, November 17, 2009 9:14 PM