What is the best way to determine the path to the ISV directory?
MSCRM 4.0
Problem:
I'm currently storing xml files in the ISV directory along with my web applications. From a plugin (or potentially a seperate app), I need to find an easy way to navigate to the ISV directory to read these xml files. This routine will be called extremely often, so processing minimization should be a strong consideration.
Potential solutions:
Registry: There is a registry key called 'WebSitePath' with the data 'C:\Inetpub\wwwroot\CRM'. Could potentially use this to build the path. (Will this be the same on all systems/instal开发者_JAVA技巧lations?)
IIS directory data: Looping through the DirectoryEntries of path '"IIS://localhost/W3SVC"' I could obtain the the web application where description is equal to "Microsoft Dynamics CRM". (Will this be the same on all systems/installations?)
Webservice: Create one to read and return the data contained in these xml files The webservice would have easy access to its executing directory.
Database: Store the data of these files in the database.
Help:
Can anyone suggest a simpler solution to obtaining and reading a file from the ISV directory? If not, which of the above solutions would be the quickest to process?
Thanks for any and all contributions.
If you manage your deployment, I would first try to access the file at the location that you think the file can be found (like an hint). If you can't find it, I would try to retrieve the ISV folder location using the registry.
If you are not controlling the deployment, using a file in the ISV folder is not a good solution, because CRM can be deployed using different roles, and the ISV folder is not necessarily on the same server, so I would rely on a external database.
精彩评论