Installing SP2007 solution to SP2010

It went actually pretty smoothly, however I met one error in our solution:

The path to the configuration data of the solution was done in following way:

Environment.GetFolderPath(Environment.SpecialFolder.CommonProgramFiles) + @"\Microsoft Shared\web server extensions\12\Config\oursuperconfig.xml");

The “12” folder is hard coded into the string so it cannot work for sp2010 because it stores data in the “14” folder.

I found a SharePoint function SPUtility.GetGenericSetupPath that can handle this problem. This function returns the correct folder for both SP versions:

SPUtility.GetGenericSetupPath("config")+"oursuperconfig.xml"
Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: