0
votes

The following code snippet is expected to return the hive path for SharePoint (..\Microsoft Shared\Web Server Extensions\14), instead it returns null.

using Microsoft.SharePoint.Utilities;
string featurePath = SPUtility.GetGenericSetupPath(string.Empty);

What am I missing?

1

1 Answers

0
votes

SPUtility.GetGenericSetupPath() returns the SharePoint hive path based on registry key

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Shared Tools\Web Server Extensions\14.0\Location

Could you check it value?