开发者

C# Console Application User-Editable Settings

I'm a web developer building my first production grade console application (C# .NET 4.0). I have a question about creating a settings file that the user can e开发者_如何学JAVAdit before running the console app (to customize output folder paths, etc).

I'm a little confused -- when I publish my console application and install it (by clicking on on the generated setup.exe file in my target publish folder), all I get is an entry to my start menu. Nothing gets installed to C:\Windows\Programs, and there doesn't seem to be anywhere else on my system that files get installed to. Essentially, I'm just trying to find the app.config xml file so that I can edit it after the program has been installed. (btw, when I click on the start menu entry, the program executes properly).

Is what I'm trying to do possible?


For a clickonce deployment, the files will be installed under the profile of the user who installed the application (by default).

For windows XP this should be:
C:\Documents and Settings\username\LocalSettings\Apps...

For Windows 7 (and Vista?) this should be:
C:\users\username\AppData\Local\Apps...


An installation program for your software is a separate piece of software.

You can definitely make one but when you compile your console app it doesn't create an installation executable. It just makes it's own executable. You can copy that executable alone and run it. If you need more resources to go along with it and therefore decide you want an installation program, you have lots of options.

The two that spring to mind in this case though, are setting your project to use "ClickOnce" from the project properties, or adding a "Setup and Deployment" project to your solution from the "Other project types" section of the add project dialog box.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜