I added the Microsoft.SharePoint.dll into a console application and have written some SharePoint code, i can see the results on the console, but when I created a Web API project and added the same code, its throwing the error. Any idea what I am missing? Does Web API support SharePoint or tweaks have to done?
Console Application:
Able to get the count of alerts on the site
Web API Application:
Getting error here...
Update1: Hosted the Console and Web API app in the same server where SharePoint is installed. Null reference is for the SPWeb object.
Update2: Not all the values of SPSite and SPWeb objects are not filled with SharePoint data. Some values like SPSite Id are returned, but not all.
"Function evaluation disabled because a previous function evaluation timed out. You must continue execution to reenable function evaluation."