"This control does not allow connection strings with the following keywords: `Integrated Security', `Trusted_Connection'"

I ran across an interesting situation recently with an application I have running on one of my WSS 3.0 boxes that performs a backup of our MCMS site.  It had been a few months since I had a need to run the app, but when I attempted it this time I came across the following error:

This control does not allow connection strings with the following keywords: `Integrated Security', `Trusted_Connection'

"Ok", I thought…this is strange.  Up until then, the application had been running just fine with no errors.  We use "mixed" authentication on our SQL boxes (standard practice), so this error didn't really make sense to me since I've been using "Integrated Security" on it the entire time and have never had any problems. 

After Googling this (with very little success I might add), I came across a few solutions that lead me to a work-around.  It turns out that when installing Windows SharePoint Services 3.0 on the server, the web.config on the default site (where WSS was installed and where the web app was running) gets modified to include multiple lines of configuration settings to help get WSS running.  No big deal…I knew this already, but apparently this can mess with how (some, not all) web applications connect to SQL by limits set on security (which are defined in the "Security Policy", and "Trust Level" sections of the web.config).

In an attempt to fix this error, I ran through each of the possible options for making a connection to SQL (including passing the username and password as clear text – bad bad bad!!)…the only option that seemed to work was to use SQL authentication instead of windows authentication.  This, of course, was not going to work for us since it's always our practice to use windows authentication for security and compatibility with all of our web applications.

I then tried removing WSS from the box (it's just a dev box to no big issue there), and removing all references in the default site web.config to SharePoint…but still no success.

I then tried creating a new Website in IIS (using a separate port 8080) and copied the app to this. 

Lo and behold – the web app now worked!! 

So, even though I basically had reset the web.config back to its original state prior to the installation of WSS (or at least to where I thought it should be), there may still have been something possibly in the IIS Meta data that was screwing with the web app (my guess anyways).

Why none of the other numerous web applications (that all have similar SQL connections by the way) running on the box didn't fail…I have no clue.  But in my case, the fix apparently seemed to be to simply move the web application to a different site to make it work.  My next step will probably be to redo IIS on the dev box and see if I can fix whatever's wrong, but for now I can at least access the web app in question with a port:8080 workaround.

For reference, here's a few links to some of the sites that lead me to this fix:
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1918708&SiteID=1
http://www.eggheadcafe.com/software/aspnet/30460993/this-control-does-not-all.aspx
http://robotmindsofrobotslaves.net/?p=39

Leave a Reply