If you want to make sure that you aren’t using any of the restricted APIs before you deploy your solution to a sandbox environment, manually reference your project against:
[SharePoint Root]\UserCode\assemblies\Microsoft.SharePoint.dll
If your code compiles, then you’re pretty safe!
NEVER DEPLOY code with this Microsoft.SharePoint.dll reference, instead reference the Microsoft.SharePoint.dll in
[SharePoint Root]\ISAPI folder.