I have a console application which has target .NET 2.0
It is very short but full of unsafe code.
I converted it to VS 2010. I run it OK.
When I try to change "target framework" in properties to 3.5 or 4.0 it shows message box:
TargetFrameworkMoniker: Error parsing application configuration file at line 0. XML document must have a top level element.
the target then stays 2.0 anyway.
This happened to me because my project file was marked as "Read Only" in its properties. Changed it, and it was fine.
It also could be caused by read-only app.config/web.config
Found the solution. Simply opened app.config in text pad (it was empty for some reason) and pasted:
<?xml version="1.0"?>
<configuration>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With