>A C# ASP.NET program under development (VS 2005) works fine in the development box, using the virtual localhost server.
>Once I tried to "Publish" the site, pressing the [Build->Publish Web Site] menu option, it compiles and gives the following error:
>
>
Data at the root level is invalid. Line 1, position 1.>
>The compilation fails at line 1, the line containing the [xml version="1.0" encoding="utf-8"] declaration.
>The simplied web.config file is shown below. As you can see it has nothing out of the ordinary.
>
><?xml version="1.0" encoding="utf-8"?>
><configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
> <connectionStrings>
> blah blah...
> </connectionStrings>
> <appSettings>
> blah blah...
> </appSettings>
> blah blah...
> blah blah...
></configuration>
>
>I have googled and found a few entries on this error, most of them talking about SOAP and web services (not what I'm doing here), and none of them have helped.
>
>I tried to recompile taking out the encoding=utf-8 section and also taking out the xmlns definition but I still get the same error.
>
>I also made sure that there was nothing before the top line (you get a different compiler error if it is not) and I checked that the XML is well-formed.
>
>Any ideas to try next?
>
>TIA
Alex,
The root of the XML file is the Configuration element. I am not familiar with 2.0 config files, but I suspect that the problem lies within the namespace (xmlns) attribute.