This is an on the fly post, if you are creating a web part solution you’ll prompted by the visual studio whether to deploy that as a sandbox solution or a farm solution. But the sandbox solution option is grayed out.
The below post explains what is the reason for that and how to solve the problem using SharePoint Power Tools.
http://sharepoint2010learnersworld.blogspot.com/2011/04/why-sandbox-solution-will-not-support.html
Direct Link to SharePoint Power Tools : http://visualstudiogallery.msdn.microsoft.com/8e602a8c-6714-4549-9e95-f3700344b0d9/