SharePoint site not reading web.config

The last few weeks I’ve been struggling with a problem for which I couldn’t seem to find a solution. I tried implementing the Faceted Search solution found on Codeplex: http://facetedsearch.codeplex.com/. With this solution, it’s possible to enhance the search options of SharePoint to show search facets. With these facets, the user is able to narrow down the search results by specifying things like language, author, content source, etc.

I downloaded the solution file, installed it and followed the steps in the installation guide. But when it came to previewing the ‘Search Facets’ webpart, all I got was a ‘Unkown error occurred’ message. The SharePoint log didn’t provide a clear error message and neither did the event log. I tried redeploying, making sure all web.config settings were correct, nothing seemed to help.

After a few weeks of trying stuff and getting annoyed with a problem which I couldn’t fix, I suddenly noticed that changes I was making in web.config weren’t causing a recycle of the application pool. So I started investigating and found out that even completely stopping the website and application pool in IIS didn’t seem to shut up the site, everything just keeped on working. So apparantly, something else was hosting this site and not the IIS site I thought was hosting.

The site was secured with an SSL wildcard certificate, and there lies the solution. When a wildcard certificate it used, a script (cscript adsutil.vbs set /w3svc/123456789/SecureBindings “:443:web.site.com”) has to be run to bind the correct host header to that SSL secured site. Now I apparantly forgot that step or the IIS setup got corrupted somehow, either way the bind was on the wrong site. So IIS redirected all calls to web.site.com to another SharePoint site.

So you might wonder why I didn’t see the other site instead of the one I was trying to visit? Well that’s because of the alternate access mappings I had setup in SharePoint. With those you can manage which host header belongs to which site, and apparantly this also works even when the call is made through another site than the configured one.

So to conclude: the web.config of another SharePoint site was loaded and therefore it didn’t have the configuration settings needed. That caused Faceted Search to fail with a rather useless error. But now everything is straightened up again and faceted search is working on all sites: woooohooooo! :)

SharePoint Connections 2010: Amsterdam

Just returned from two days of fun @ SharePoint Connections 2010! Great conference with lots of excellent speakers including Steve Fox, Jan Tielens and Richard Taylor (and many more offcourse).

Got to see some pretty exciting things, primarily about SharePoint 2010 (duh), Visual Studio 2010 and the new developer stuff which that combination brings. I’ll try to quickly discuss the main things.

The integration of SharePoint development which lacked in Studio 2008 is now available in 2010. This is being advertised quite big, but I think every SharePoint developer would not have expected anything less. Ok, the features are great and there’s more then just an integrated version of VSEWSS, but still; this should have been there a long time ago.

The new integration does bring some  cool stuff to the table. There’s editing of BCS (the new BDC) files, there’s Visual WebParts and visual design of workflows in a neat way. With this new release, SharePoint development in Visual Studio has grown up and matured, cancelling out a lot of the difficulties which were there in 2008. There are some minor drawbacks though… VS2010 and SP2010 are a team and the team members don’t play well with the older family members. So forget about creating 2007 stuff in VS2010 and be affraid for upgrading VS2008 SharePoint projects to VS2010 projects; things will break and customers will be disappointed.

As Richard Taylor stated a couple of times in his talks: nuke and start from scratch! Wasn’t exactly what I was hoping for I must say, but as I saw all the changes I’m starting to believe that might be the better approach. In what way you could migrate sites with existing data to your new 2010 environment I’m not sure, but I’ll keep you updated on that as well.

As for 2010 beta solutions: be carefull with that too. The migration options include an update 2007 -> 2010, but not 2010 beta -> 2010. So when the RTM version is released, you’ll won’t be able to upgrade beta sites to the RTM version.

In the near future I’ll be doing more tests and practice runs with the 2010 beta versions of Visual Studio as well as SharePoint, so please watch my blog for more updates on these topics. As for now, I’m preparing for a good night sleep, my final day at work and then some… SNOWBOARDING!!! YEAHHHHHHHHH

Solving the “Invalid object name ‘AR_CacheCounters’.” error in the SharePoint logs (unresolved)

Many people seem to have the same error in their log files:

“Invalid object name ‘AR_CacheCounters’.”

It’s not clear where it’s coming from, or how to solve it. I’ve searched some hours looking for a solution, but I could only find some indications it could have something to do with search. I finally just tried (it’s not a live environment yet) killing the search service and restarting it again, and that seemed to have done the trick.

So this is not a guaranteed solution, but you can try the next steps:

stsadm -o execadmsvcjobs
stsadm -o osearch -action start (just to be sure it’s started)
stsadm -o osearch -action stop

It’ll ask you if you really want to lose your index, answer “y” (in the dutch version it states [j/n], but answering ‘j’ doesn’t work).

Now start the service via central administration again and make sure you reattach your SSP to the indexer service, because it will get detached when you stop it. After I’ve done this, the errors seemed to have disappeared from log. I’ll update this post when I’m sure it’s the solution or if it didn’t really fix it.

Update 2009/12/10: didn’t seem to do the trick after all, the errors happily returned to the log files over night.

Project 2007 and 2010 side by side

I’m playing around with the new 2010 apps a bit. Offcourse I’ve got a SharePoint 2010 environment in which I also added Project Server 2010. I’ve also installed the client, since the installation gave me the option to leave my existing 2007 installation in it’s place. Now for some reason, the 2010 client wouldn’t connect to the server. I’ve sent a frown smiley face to Microsoft (which is a feedback tool which ships with the Office betas) with the fault details, so hopefully someone will follow up on this.

Fortunately, uninstalling the 2010 beta fixed the 2007 error for me. I’m now again able to open and save projects to our 2007 project server environment. So for those of you wanting to try out the new 2010 beta’s, it’s probably best to use a VM of VPC image to install the client. Although the installer gives the suggestion that side by side operation is supported, it clearly doesn’t work too well.

Gotcha! DATE / DATUM calculated formula column in SharePoint

A colleague of mine had a question about a  calculated column. He wanted to link an expire date to documents in a document library, but users would have to choose a retention period of 1-10 years.

Not that hard if you create two site columns; one of type ‘choose’ which presents the options 1-10 in a dropdownlist. The second one would have to be a calculated one with the following fomula:

=DATE(YEAR([Created])+[RententionTime],MONTH([Created]),DAY([Created]))

So far, so good. But when we wanted to deploy in a production environment at a customers’ site, SharePoint started complaining it didn’t understand the formula.

Seems the same trick which applies to Excel also goes for SharePoint: formulas have to be translated. And no, not only the names of the columns, but also the names of the methods and even the syntaxis is different. We ended up with this (in Dutch):

=DATUM(JAAR(Gemaakt)+[Bewaartermijn in jaren];MAAND(Gemaakt);DAG(Gemaakt))

Notice that even the comma’s are replaced by semicolumns; it won’t work otherwise. You can use a localized version of Excel to check the syntaxis; it seems to be the same (although not all methods are supported offcourse).

Allow BDC access to all FBA users

I was struggling a bit with my FBA users in SharePoint. I’ve created a customer portal setup in which BDC data is shown. But FBA added users aren’t allowed to view BDC data by default, not even when you add groups like authenticated users and Everyone to the BDC permissions list.

When you want to enable BDC access for your FBA users, you need to create an extended site for your SSP administration site. This extended site should use your FBA membership and role provider. And that last one is key in this scenario.

So I created that extended site, added some FBA users in a SharePoint group (seemed logical enough) and tried to add that group to the BDC permission. The following error was thrown: “The specified user or domain group was not found.”. Dead end? No!

The roles you provide via your membership provider can also be used to assign  rights to. So when you’ve got a role ‘Customer’ and some users are added to this role, you can enable access to the BDC entities simply by granting access to the role Customer. You do this by typing in Customer in the Users/Group textbox and SharePoint automatically resolves it to your role.

Note: you have to do all this in your extended membership provider. In the normal one, it won’t work because it won’t recognize your role provider (the default is set to the windows token provider).

So:
- Add a Role in your FBA database
- Add all users to that role (you can do the programmatically with the membership model of ASP.NET)
- Give the role access rights to BDC entities
- Done!

If you want to enable all rights at once; set them at root BDC level and use the “Copy all permissions to descendants” option to copy the permission to all BDC objects.

Now to find a good way of adding and managing all these FBA users.

NotSupportedException in localized Compact Framework app

Today I was working on a Pocket PC app using Compact Framework 3.5. The app ran fine on the VS emulator, but when I finally deployed to the actual Pocket PC devices, it started throwing exceptions. The exceptions being thrown were of the type NotSupportException with the message System.Globalization.CultureInfo. Yeah great error message guys, I can really work with that…

The weird thing was that some forms were working fine, whilest others weren’t. I couldn’t detect any difference in references or code; all exactly the same. Finally I found some posts about the possibility of the resource (.resx) files being corrupted themselves. As a last resort I tried deleting the resource file of one of the forms and recreating it from scratch. And magically! That form started working again!

So apparantly, the cryptical errormessage means your resx file is corrupted somehow. I couldn’t figure out what was wrong with the other ones, but they all started working again once I had recreated them from scratch.

So if you need the above solution: I hope you don’t have too much forms to re-edit….

Services.msc only displays Standard tab correctly / Project web panes problems

I faced a problem on my development machine. The following symptoms were visible:

1. The services.msc window only displayed the “standard” tab correctly. The extended / advanced tab was broken and only displayed the topleft blue bar. No text, no services, nothing.

2. In my Project installation (2007 office client) all the web panes broke. When I started one of those panes, an error displayed complaining about Srchui.dll and Jscript.dll not being registered properly. Those panes didn’t work at all

3. When I reset IE8, I also noticed adding a search provider didn’t work (JavaScript error).

That last error pointed into the direction of IE8, so I uninstalled it. And as magic, everything started working again. Then I reinstalled IE8 again and untill now everything still works properly. So I’m not sure about what exactly caused the problem, but removing and reinstalling IE8 did fix it.

Crystal Reports webpart for sale

Because a lot of people keep e-mailing me about the code I wrote for the Crystal Reports webpart, I decided to make it available for purchase. Unfortunately not for free, since my boss seems to think I have to get paid for the work I do.

If you are interested in buying the webpart (it’s currently going at $500 for an unlimited licence), please contact me at jsiegmund_at_datamex_nl (if you can’t figure that out, you can’t buy the webpart either ;) ).

The package will contain (still have to create it):

a ready-to-go solution for installation
a seperate zip with the stuff you need to run the ImageHandler outside of SharePoint
a document to guide you through installation and usage

And offcourse I will be available for supporting any problems which might arise.

405 Bad request error while inserting – updating ADO.NET Data Service

A few weeks ago I started working on a project which involved a ADO.NET Data Service. This is a way of bringing your datalayer online and letting clients query and update entities in your datalayer (database) through RESTful webservices.

Locally everything was working fine, I tested the entire project and after fixing most bugs I was ready to deploy the service to the production server online. That machine is a windows 2008 server with IIS7 on it, so it does have some differences to my local XP / IIS5.1 environment. After deploying I went of testing again and found out that only the retrieval bits were working; inserting and updating produced errors. After enabling verbose errors on my service I found out that the server was returning a 405 bad request error.

To cut a long story of searching and debugging short: the WebDAV module which was also installed on the server was causing these 405 errors! Even though WebDAV wasn’t enabled on the particular site, it still messed up the PUT and MERGE calls from the ADO.NET Data Service. Disabling the module and removing the http handler (for the site hosting the services only) fixed the problem!

Next Page »