views:

318

answers:

2

Hi

On a Terminal Server install of my .NET 2.0 WinForms app, one of my clients gets the following exception on startup: "Unrecognized configuration section connectionStrings" This is occurring in myapp.exe.config but I can't figure out why. Runs perfectly everywhere else, only difference between this install and any other is the connection string.

I've searched around, but can only find this issue relating to ASP.NET apps and issues in web.config. Any ideas what could be broken in the config of this WinForms app though? Is it indicating a problem further up in machine.config?

FYI the top part of myapp.exe.config is:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <configSections>
<sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
  <section name="MyApp.Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</sectionGroup>
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
  <section name="MyApp.Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
</sectionGroup>
</configSections>
<connectionStrings>
    <add name="MyApp.DataAccessLayer.Settings.MyConnectionString" connectionString="$$$$$$" providerName="System.Data.SqlClient" />
</connectionStrings>
...

thanks

Richard

A: 

Add this inside configSections tag:

<section name="connectionStrings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=jjjjjjjj" requirePermission="false" />
šljaker
OK, I see how that might fix it. Thing is though, why has no other installation needed this added to myapp.exe.config? Also, shouldn't that be defined as type ConnectionStringsSection? <section name="connectionStrings" type="System.Configuration.ConnectionStringsSection, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" requirePermission="false"/>
Richard Bysouth
A: 

The above answer worked although the actual cause of the issue was a (somehow!) broken .NET Framework installation. Reinstalling/repairing the .NET install resolved the issue.

Richard Bysouth