Are you victim of this error? then, you must be trying to use SharePoint 2010 templates in visual studio 2010 on the system that does not have Sharepoint installed.
So how to make it work with out installing the SharePoint server on local machine? After googling around, the hack that i found is to export the registry from SharePoint 2010 machine and import it to the machine where you are running visual studio.
Follow the below detailed steps,
- Run regedit in command prompt on Sharepoint server
- Navigate to the path [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Shared Tools\Web Server Extensions\14.0]
- Copy the whole 14 hive registry by exporting it.(File->Export)
- Open the registry in local machine where you are trying to develop sharepoint solutions using VS2010
- Export the copied registry (File->Import)
The last step is to copy the SharePoint dlls at C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\ISAPI from sharepoint server to local machine.
Copy the necessary sharepoint dlls to GAC or use Gacutil to do.
Now after restarting VS you must be able to create projects using sharepoint templates.
This way i could successfully develop sharepoint solution using VS2010 when sharepoint is on a different system(in my case sharepoint online) though debugging is not possible.