I got this error while trying to publish a infopath form which contains code. The full error message is: "The form template cannot be published to the server. Sandboxed solutions
are not enabled on the SharePoint server farm".
You can also check out my previous posts:
You can enable Sandboxed Solutions from SharePoint central administration as well as from PowerShell
Enable sandboxed solutions by using Central Administration:
Open SharePoint 2010 Central Administration and then click on System Settings. Then from the System Settings section, click Manage services on server.
On the Services on Server page, Check for Microsoft SharePoint Foundation Sandboxed Code Service, Click on the Start link as shown in the figure.
Once the service start, the status will become Started as shown in the figure below:
Enable sandboxed solutions by using Windows PowerShell:
Go to Start -> All Programs -> Microsoft SharePoint 2010 Products -> SharePoint 2010 Management Shell.
Then in the Windows PowerShell command prompt, type the following command:
Start-Service -Name SPUserCodeV4