Yesterday evening, I was trying to port a simple .NET 1.1 test project of mine to .NET 2.0.
This project contained an App.Config file that contains a custom configuration section like this:

<configuration>
<configSections>
<section name="test"
type="System.Configuration.NameValueSectionHandler"/>
</configSections>
<test>
<add key="xx" value="yy"/>
</test>
</configuration>

When I compiled my project, I got the following error message from VS.NET:

Could not find schema information for the element test
Could not find schema information for the element add
Could not find schema information for the element key
Could not find schema information for the element value

I was really surprised... This just worked in .NET 1.1, why shouldn't it work in .NET 2.0 ?
I spent a lot of time searching on Google, newsgroups, etc... for more information about this error and how to solve it, but I haven't found any clue.

This morning, I restarted my quest, and I was able to solve the problem.
Apparently, I had a syntax error somewhere in my code. In the configuration file, there was nothing wrong. Once this syntax error was solved, VS.NET didn't complain anymore.
I tried the same thing in my .NET 1.1 project: I added a syntax error in my code, and compiled. The compiler complained about the syntax error, but not about the configuration file (which is good, because the config file is correct).

This is very frustrating. Why is VS.NET 2005 complaining about something in the configuration file, while the configuration file is just correct ?
On top of it, this 'configuration file error' appears as the first error in my error-list.

I really lost a lot of time due to this strange behaviour of VS.NET; why is VS.NET 2005 behaving like that, which is incorrect IMHO, while VS.NET 2003 is acting like it should.
This error is very confusing and it can really take your productivity down.

Update: I've been playing with configuration-settings in .NET 2.0 again, and again, I came across this annoying error. I've made 2 comments on this article that should provide a way to fix this.