Wednesday, May 30, 2007

Another reason for "the virtual server that is referenced here is not in the config database."

If you get the error "the virtual server that is referenced here is not in the config database" when you try to use object model, and if the microsoft KB article didn't solve it for you, and you are totaly may have the same problem I have - lack of attention.
This error appeared on my screen because I was developing on a server that has both sharepoint 2003 and sharepoint 2007, and in my project I referanced (without noticing) the DLL for WSS2 and not WSS3.
So ofcourse the code would throw an error it can't find the virtual server in the configuration database! it was looking in the wrong configuration database!
HA!, what a silly person I am...wasted half a day trying to troubleshoot this - going into the database, rebuilding the sites, rebuilding the application, extending the sites, mucking with IIS...untill I noticed the path to the DLL has "60" in it.


Vince Bullinger said...

I would suggest being a little bit more explanatory as I don't know where to change this. I'm not a Sharepoint expert. Where is this misnaming located? To what should I change it?

Ishai Sagi [SharePoint MVP] said...

Vince -
When you add a referance to sharepoint in visual studio, you will see in the list of things to add that it has several columns - one of the columns is the title - which will have Windows SharePoint Services. The other column will be the path to the dll. Because you have two versions of sharepoint installed (if you have the same problem I did), then there will be two dlls with the same name, but a different path.
The 2003 dll will have "60" in the path, while the 2007 dll will have "12" in the path. Just choose the one with 12 in the path and not the other one and you will be ok.