Using MS Visual Studio 2010. Migrated a project up to .NET 4.0 probably 2 years ago and did significant coding on it. We don't actually need .NET 4.0, just wanted to keep up with the times. But now we need a rush release and do not want to include a .net upgrade on top of all other changes.
So, I changed all targets back to .NET 2.0. When I run, the first time that I hit the app.settings, I get an error "Unrecognized configuration section connectionStrings. (c:\Folder\Program.vshost.exe.Config line 12)"
If I switch back to .NET 4.0 it goes away.
I checked all references for a reference to a 4.0.0.0 system.* Nothing found.
I did a text search of *.cs and found files Settings.Designer.cs had a comment referencing it...
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.18444
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
Any ideas where else to look?
I eventually figured out my .NET 2.0 System.Configuration had become broken (anything that used an app.config file). The telltale sign was when I did a fresh install of our released product that works on thousands of computers and it failed the same way as my development code that I was trying to re-target.
I restored my computer back to last Thursday and all went fine again. Re-targeting of the project in Visual Studio 2010 works flawlessly.
What did I do last Thursday? I installed Visual Studio 2013... I also installed some free menu-creators for the auto-run of a CD-ROM. I will be a lot more cautious if I try any of those products again.