views:

29

answers:

2

I've been using app.Config and INI files to configure my applications but I wanted to make it more user-friendly. I've already encountered some applications ( most of them are java based ) that its configurations are via web interface ( I think the application is hosting jsp ). How can I do this on .net platform fast and easy?

Thanks for the inputs guys! I'll be implementing my own web server for this to resolve my problem. Sample web server

A: 

There is no way to do this "fast and easy", as far as I know. You're simply going to have to write a web-based interface to your configuration.

Sections in configuration files can be read as objects, which you could data bind to controls on a web form. If it's your own configuration, then you can know ahead of time what it looks like, and what form to use.

John Saunders
I wanted to use ASP.net for my web interface but I don't have any IIS installed on the servers. Does this mean that I need to host my web app on my console application ? how can my web app communicate with my console application?
powerbox
The web application won't communicate with the console application - it will communicate with the configuration files. And you _will_ need to host ASP.NET somewhere, either in the console application, or in IIS.
John Saunders
can you not build a gui in a winform app to achieve the same thing?
rockinthesixstring
Thanks that gave me a big help. Hmmm can I host my web application on my console application by the way?
powerbox
see my edit in my answer. You'll have an easier time building a small web forms app to do your config and forget all about the web app and IIS.
rockinthesixstring
@powerbox: I believe you can host it in a console application. I've seen it hosted in a Windows Service.
John Saunders
+1  A: 

You can create your configuration files however you like. Transmission uses JSON for it's config, while apps like Active Home Pro use XML.

Writing out your config and consuming the data is totally up to you. If you use ASP.NET MVC, you can spit out JSON data with ease, and XML is almost as easy. The question is how is the user getting the config after they have gone through the GUI?

  1. do they download a text file?
  2. Does the browser app run locally and configure the text file in place?

also note: by text file i mean any config file (xml, txt, csv, json, etc)

EDIT

What about building a Windows Forms application for the configuration. It can be a single window (like a single web page would be) and it does all the config on the local machine. Then the console app reads the config without the user knowing any different. All the user has to do is open the config editor.

MyApp.exe
AppConfigurator.exe

EDIT 2

I'm not entirely sure if this is an option, but Microsoft has also just recently released IIS7 Express (a standalone version of IIS), but unfortunately I'm not sure if this is to be used in any type of production or if it's only to be used for development.

EDIT 3

Here is a link to How you can Host an ASP.NET Website Outside of IIS.

rockinthesixstring
I would presume that the user doesn't get the config file at all, but rather the web application will modify the config file in-place.
John Saunders
@John, I agree. But the OP has said he has no access to IIS so this could be more of a challenge than just building a WinForms GUI for config. See my edit above.
rockinthesixstring
@rock: he didn't say he had no access to IIS - he said it's not installed. Also, IIS is no longer a requirement for ASP.NET.
John Saunders
see my second edit.
rockinthesixstring
@John, aside from IIS Express, is there a **simple** way of running ASP.NET without IIS? How would that look? (not being sarcastic, genuinely interested)
rockinthesixstring
Hi guys thanks for the inputs. I really need to make the configuration via a web interface and not on windows form since it is part of the application requirements.
powerbox
@John, I found a link on what you were commenting on. Added it to my answer.
rockinthesixstring