Monday, March 19, 2007

SharePoint SDK = .NET (Managed Code) + COM ( Unmanaged code)

Ever since I used reflector(a freeware tool to examine any .NET assembly) I check most third party assemblies before using in my code. SharePoint was no exception. I wanted to see how SharePoint communicates with SQL Server. So I started digging but to my disappointment, I couldn't find any references to database related code. But to my surprise, I discovered something entirely different (See the class below)


Most SharePoint data connection usages SPRequest class, which is in Microsoft.SharePoint.library.dll ( This dll gets copied in GAC on SharePoint machine, you will need to manually copy this DLL out of GAC if you want to see all interfaces). Now this assembly in turn usages OWSSVRLIB.DLL ( This dll is under 12\ISAPI folder). Interesting thing is, this is a COM (UNMANAGE CODE) dll, obviously reflector didn't work

So I was disappointed in my quest but I indeed found something which makes me wonder is this an intelligent design decision or simply lack of time?

1 comment:

Sheetal Jain said...

Posting on behalf of Dwinter (Microsoft)

This was part of the design (and was the same in 2003 actually) and not a lack of time.
You don't have to copy Microsoft.SharePoint.dll out of the GAC to access it, it also in ISAPI with owssvr. You might note that when you develop on a server with WSS installed that when you add the Microsoft.SharePoint reference, it is the ISAPI one that gets used and not the GAC...