WSE032: There was an error loading the microsoft.web.services2 configuration section.

This error cost me far too much time the other night whilst I was trying to migrate an application from preproduction (where it worked fine) to production (where it shit itself and gave that error when I tried to start it up.)  It was a windows service that used a regular config file for its config information, and I added a Web Services Extensions section to that config file in order to raise the size limit allowed for file transfers. (I know Microsoft claim its a security mechanism, but for us its just been a constant pain in the ass.)

There are lots of articles around that say what can cause this, but none which address the actual cause in my case.  This should have been caught at a preproduction level and I can only guess that security on my preprod box must be lacking somewhat – a lower restriction level then our production box perhaps. 

In your config file, you’ll have something like this:-

   

You need that section to allow you to include the microsoft web config section later in the pile, and its in this section that my error lay.  I copied it verbatim from somewhere on the web when I was first troubleshooting the size limit problem (I wasn’t sure you could use this seciton in an app config, most wse apps discussed seem to be web apps, not windows services, funnily enough.).

My first thought when I identified this as a potential problem area was that I’d forgotten to replace the publickeytoken with the actual one my copy of the dll uses.  No love there though, they were the same value 😉

I left it then and didn’t come back to it till i’d wasted plenty of time chasing other blind holes to notice the version number.

The one i’d copy, as you can see there, states the file is version 2.0.0.0.  Turns out my copy of the dll that I was using with the app was version 2.0.3.0.  I only found that out by accident, looking at the dll in the file viewer of visual studio.

I guess the moral of this story is to check the file information first and ensure its all ok, before chasing obscure host-file bugs and other weird things the net was suggesting.

Advertisements

4 thoughts on “WSE032: There was an error loading the microsoft.web.services2 configuration section.

  1. im having the same problem and yes i pasted this code from a form in app.confing

    luckily enough i checked the version which matches my refernced Microsoft.Web.Services2.dll

    but the prob is still there … 😦
    any idea ????????

    😦

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s