Reputation: 820
I am new in .net.
I am actually converting a Console application into Windows application in .net. And I want to include some configuration files in the windows application.
I know that for web application there is Web.config and for Console application there is App.config to have the configuration details.
But I don't have any ideas about the configuration file in windows application. I have to include the configuration details in my windows application that included in the console application that i want to convert.
UPDATE
Problem Fixed.
It is a fault from my part. I also copied startup
tag. Can anyone please tell me for what this tag.??
Thant you all for the replay.
Upvotes: 0
Views: 235
Reputation: 13248
Right click on your project go to -->Add --> New Item and then you will find a dialog as shown
Upvotes: 2
Reputation: 56727
Go to the project's properties and change to the "Settings" tab. You might see a message that no settings file is present right now. If you click the link, one will be created.
Add one setting as a dummy so that all sections in the app.config
file are created (<applicationSettings>
or <userSettings>
and the respective section for your namespace). Then, open the original config file in a text edit, copy the settings lines (not the lines containing the <namespace.properties.settings>
start and end tags) and then paste them into the new app.config
. Make sure that you copy application settings to the <applicationSettings>
section and user settings to the <userSettings>
sections accordingly.
The next time you open the Settings tag, you'll be asked whether you'd like to import the new settings.
Upvotes: 3
Reputation: 2861
There’s a really simple way to do this.. simply go to the File \ Add New Item menu, or hit Ctrl+Shift+A
You’ll notice that it’s already set to App.config for you. Just hit the Open button.
If you look in the Solution Explorer, you will see that the config file is in your project:
Now build your application, and take a look in the \bin\debug\ folder. You’ll see that the configuration file has automatically been generated and named correctly for your executable:
Reference taken from HERE
Upvotes: 2
Reputation: 216343
A windows application is a WinForms or WPF application and use the same App.Config renamed in yourappname.exe.config
as in Console Applications. So just go on with that
An excellent series of articles on configuration files (I will dare to say the reference
)
Unraveling the Mysteries of .NET 2.0 Configuration
Upvotes: 3