So i created a standard ASP.NET WebService Application, referenced the Microsoft.SharePoint.dll and created a WebService method that returned the current logged-in user – nothing out of the ordinary. Then i tried to start the web service out of visual studio and got the following error message:
I didn’t really know why it said it couldn’t load the Microsoft.SharePoint.Sanbox.dll because i didn’t even reference it. I tried to remove the Microsoft.SharePoint.dll from my references and it still gave me this error – weird.
After a bit of digging around what might could have gone wrong, i noticed that the Sandbox.dll somehow ended up in my WebService’s bin folder. So i went with the most pragmatic solution – i deleted the .dll, rebuild the project and everything started fine.
Still don’t know whats wrong, but hey – it works.