Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Post
An Article
A Blog
A Video
An Ebook
An Interview Question
Register
Login
2
Reply
Application Configuration File Error
HumptyNotSoDumpty
Jul 30 2004 7:49 AM
2.2k
Reply
I have attempted to use an XML Application Configuration File, but am getting the followin error: Error loading XML file file:///D:/Test/bin/Debug/Test.exe.config 'XML' is an invalid name for a processing instruction. Line 1, position 3. (D:\Test\bin\Debug\Test.exe.config) Has anyone encountered this problem before? I am unable to resolve the issue, and am beginning to wonder if its a glitch within VS 2002. My XML file 'Test.exe.cofig' is as follows:
My code is as follows: using System.Collections; using System.Configuration; using System.Windows.Forms; namespace Test { public class Form1 : Form { private Button btn1; [STAThread] static void Main() { Application.Run(new Form1()); } private void btn1_Click(object sender, System.EventArgs e) { try { MessageBox.Show("Keys Count: " + ConfigurationSettings.AppSettings.Count.ToString()); } catch (Exception e) { MessageBox.Show(Main.Message); } } } }
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
2
)
Next Recommended Forum
JLOOX equivalent third party software for C#.Net GDI
Converting string to int