What is the best way to determine the path to the ISV directory?

Posted by Luke Baulch on Stack Overflow See other posts from Stack Overflow or by Luke Baulch
Published on 2010-01-28T00:40:12Z Indexed on 2010/04/10 3:03 UTC
Read the original article Hit count: 360

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/installations?)

  • 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.

© Stack Overflow or respective owner

Related posts about mscrm

Related posts about microsoft-dynamics