I have made a web part in Visual Studio in which I am using the following class:
It is working fine. Then I created a new visual web part project and tried to use this but it says:
The type or namespace name 'SPServiceContext' could not be found (are you missing a using directive or an assembly reference?)
Even though I have already added Microsoft.SharePoint at the top plus I have added its reference in project.
How to fix this?