Francesco Picchi
Could you elaborate on why calling a console application from a plugin is one of the worst things to do from a plug-in?
I am attempting do write a project that does something similar. I have no clear cut final goal of my project but I just want to find the full capabilities of the plug-in.
Somethings I attempted to do in my CRM Plugin is,
- Open a console application (both local and also from our company network)
- Create a folder on my desktop
- Open a file
- Establish a MySql or PostgreSQL connection (And just open it - simply for testing purposes).
My company is uncertain of what we want the plugin to do but we want to get an idea of what is possible. For example, one of the main things we wanted to do with the plugin is, say for example:
1) User creates a new customer contact
2) Once the new contact is made, open a console application that will add the credentials of this new customer to a different database
As I mentioned above, I attempted to perform each of these basic tasks within the execute method of the plugin. Every time I attempted to call a function from one of their respective libraries, I would receive a error that seems to reference the library.
- For example
1) If I were to set up a mysql connection (With the correct connection string) and then call mySQLconnection.open()
- I would be thrown an error on //Request for the permission of type 'System.Data.SqlClient.SqlClientPermission, System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
2) If I were to create a new folder on my desktop (Or anywhere really), and then call Directory.CreateDirectory(folderPath)
- I would recieve a similar error to the one above except it refers to the library this method is from, FileIOPermission
Could you elaborate on why these are bad practices for the plugin?
Would these occurs if I were to attempt any of these basic task within any .net class library project? or is it only because this is a plugin?
I have also seen suggesstions for giving my project, "Full Trust" permissions. Unfortunately that is not even an open to set in my properties, why is this? Can I give it full trust else where?