In this post we will discuss how we can resolve the issue which comes when we build a SharePoint solution or project. The error comes as:
The type or namespace name ‘SharePoint’ does not exist in the namespace ‘Microsoft’ (are you missing an assembly reference?)
The type or namespace name ‘Server’ does not exist in the namespace ‘Microsoft.Office’ (are you missing an assembly reference?)
Also you can read:
– Deploy Administation approved InfoPath forms in SharePoint 2013
– How to extract dll from assembly folder and Install Uninstall DLL into Global Assembly Cache?
– Delegate Controls in SharePoint 2013 using Visual Studio 2013
From the error message the first impression comes as we need to refer to Microsoft.SharePoint.dll and other dlls. But in our case all the dlls has been refered correctly. But still we were getting the issues.
Just to let you know that here we were working with an InfoPath form (2007 version) which has code and we were trying to modify in SharePoint 2013. Here we gave reference to all the dlls but still when I was building the project it was giving the above reference error.
The solution is simple. Right click on the Project -> Click on Properties.
Then in the Application tab, click change the Target framework to .Net Framework 4.5 like below:
Now again try to build it should work fine.