Opening InfoPath form in SharePoint ‘Requested registry access is not allowed’

8 12 2009

This is another gotcha that I’ve run into today – when I went to publish an InfoPath form to my SharePoint site I spotted an error in the design checker ‘Invalid Form Template’. I ignored the error and carried on but when I tried to create a new form based on the template in the document library, I received the following error –

Requested registry access is not allowed. at System.ThrowHelper.ThrowSecurityException(ExceptionResource resource) at Microsoft.Win32.RegistryKey.OpenSubKey(String name, Boolean writable) at Microsoft.Win32.RegistryKey.OpenSubKey(String name) at Microsoft.Win32.Registry.GetValue(String keyName, String valueName, Object defaultValue) at Microsoft.Office.InfoPath.Server.Runtime.FormServer.<>c__DisplayClass1.b__0

I did some research and came accross this blog post from Joel Oleson (@joeloleson) which helped me fix the problem –

http://blogs.msdn.com/joelo/archive/2008/01/02/evaluation-version-expired-but-not-really.aspx

The steps I took to fix the error were slightly different from Joel’s (see below) but his blog post helped to point out the registry keys on which the access was failing.

The application pool account for my SharePoint web application was running as ‘Network Service’, I did try and add this account to the ‘Distributed Com Users’ group but this did not fix the problem.

Initially I changed the application pool account for the web application to a domain account and this fixed the problem, then I changed it back to Network Service and gave that built in account read permission on the registry key –

‘HKEY_LOCAL_MACHINE\SOFTWARE\MICROSOFT\Office Server\12.0’

and that also worked! So there are two options in case anyone runs into the same problem.

Hope this helps 🙂