how to modify app.config for visual studio.net 2003, .NET 1.1 - app-config

Dim config As Configuration = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None)
config.AppSettings.Settings("test").Value = "blah"
config.Save(ConfigurationSaveMode.Modified)
ConfigurationManager.RefreshSection("appSettings")
not work
I want to edit/modify app.config
I use visual studio.net 2003 and .NET1.1

This question was already asked here: Why are my application settings not getting persisted?
Probably you're looking at wrong folder while in debug/release mode.

Related

Visual Studio Installer Setup Project [duplicate]

This question already has answers here:
Visual Studio 2017 setup project missing
(6 answers)
VS2017 Setup Project - Where?
(2 answers)
Closed 4 years ago.
I'm wondering how to use Setup Project in Visual Studio 15, which was in
Solution -> Add -> New Project -> .../installed -> Other Project -> Types -> Visual Studio Installer ->Setup Project
but this disappeared. To create an .EXE file for a Windows Form Desktop application, it seems like it is no longer available.
Or how can I access the same functionality with higher versions?
There is an extension that brings it back for backwards compatibility. But at the same time the guidance has been to finally move to a Wix installer or some other installer technology.
The Installer projects are considered deprecated and bad. They can't be easily built using a CI server and more issues.
The proper solution would be:
Use Wix Installer project (if you need Visual Studio project support)
Simple tutorial
Pluralsight
Use something like NullSoft Installer (just build the installer by building it outside of Visual Studio.
If you have an existing investment in the old style installer projects, you can still use the extension. If you're building something new. DON'T. It may be the simplest way of adding an installer, but it'll cause more issues in the long run.

Visual Studio 2010 Saving Projects

To All,
I haven't used a Visual Studio in quite a few years, and don't remember what version I had used. I created 15-20 libraries and 30-40 utilities - all in C.
I recently decided that I wanted to enhance some of the libraries and utilities and acquired Visual Studio 2010. I open an existing project (.dsw) and I get a popup that says "The project ' must be converted to the current ... Convert and open this project?' I click on Yes. I then get a popup that says "A file with the same name ... already exists on disk. Do you want to overwrite the project and its imported sheets?' Again I say Yes.
I go along my way and make a bunch of changes to the project. I click on "Save All." I then close the project and when I reopen, it is like I didn't change anything! I get the same popups again!
I've check the permissions on the directory and files and they should be writable. I have SCOURED the net trying to find out what I am doing wrong to no avail.
Any helpful pointers would be greatly appreciated!
TIA,
je
.dsw extension was used by Visual Studio 6, Visual Studio 2010 project files have extension .vcxproj. The conversion process mentioned in your question creates those new project files. Open them instead of old .dsw

Visual Studio 2010 errors on build of project with WPF DataGrid

I've moved a C# project from Visual Studios 2008 Professional to Visual Studios 2010 Express.
It converted the project successfully with the VS migration wizard, but the build is failing.
There are quite a few errors, all having to do with the WPF Datagrid. The errors don't occur when built in VS2008. For example:
'DataGridRow' is an ambiguous reference between 'System.Windows.Controls.DataGridRow' and 'Microsoft.Windows.Controls.DataGridRow'
I see that the project also uses WPFTools.dll.
With VS2010 maybe WPFTools.dll is no longer needed? Or maybe I need to use the Professional version instead of the Express version of VS and the project wasn't successfully migrated?
I think I can edit all the places where this is a problem using the full namespace to make the error go away, specifying either "Microsoft.Windows.Controls" or "System.Windows.Controls", but I'm not sure which of the two it was defaulting to under VS2008.
This is most likely tied to the .NET FW version, ie...was this 3.5 prior and you migrated to 4? If so, you would have been using the WPFToolkit prior whereas the DataGrid is now part of the standard FW in 4 and greater.
Remove your references to the WPFToolkit and use the standard FW class and you should be fine.

Set app.config parameters from a Visual Studio 2008 Setup project

I have a WinForms application that uses a config file to specify where it's external files will be created.
Is it possible to use the installer to question the user where the files should be located and add this value to the config file?
It would also be good if I could confirm that the user has entered a valid path but that's just a "Nice-to-have" at the moment.
Following the helpful hints from Pete, I was able to find this blog that does exactly what I need.
There are a few Gotchas to watch out for and I've covered them here but these may be Visual Studio 2008 specific issues.

Changing the config file in a Visual Studio Package

I'm building a Visual Studio Package and associated with it, I have an app.config file (which contains some information about connecting to a WCF service).
As far as I can tell, this package is actually connecting to the devnev.exe.config configuration file (if I use AppDomain.CurrentDomain.SetupInformation.ConfigurationFile), it will retrieve the path to the devnev.exe.config
Firstly, is this correct? Shouldn't the package automatically pick up the app.config file? If this is the case, then how can I make the project use the app.config file?
I'm running VS2010 Ultimate, programming in C#.
A Visual Studio Package will take the devnev.exe.config configuration file as its main configuration file. If you add an app.config file into the project, it will not accept it. This is because the package is running within Visual Studio, therefore it is accepting Visual Studio's config file.
At the same time it is not good practice to change the devnev.exe.config file, since once you deploy your application, the user will also have to change that file (and on the whole, you shouldn't change that file).
What I ended up doing is connecting to the WCF service programmatically.
Hope this helps somebody.
When you compile your project the app.config is compiled as [exe].config.
If you want to change configuration you can change the content of [exe].config (it's a plain text document).

Resources