app-config

Added new application setting to app.config but MSI won't install it (doesn't overwrite)

╄→гoц情女王★ 提交于 2019-12-17 21:36:40
问题 We recently added a new application setting (not user setting) to the app.config (URL to a logging server) of our legacy winforms application (.Net 4.6.1). Old version was 1.0.3, we changed the version of all assemblies to 1.0.4 and in the Setup project (Visual Studio 2017 Installer Project) changed the version to match which gave up the pop-up to change the product code, which we did. The install runs correctly (other things were changed too by the way, and those changes are correctly in the

App.config: User vs Application Scope

流过昼夜 提交于 2019-12-17 17:26:33
问题 I have added App.config file in my project. I have created two settings from Project > Properties > Settings panel - I have noticed that when I am adding a setting, I can define scope as User or Application . - User Application If I define setting as User it goes to userSettings section, if I define setting as Application it goes to applicationSettings section App.config <configuration> <userSettings> <DemoApp.Properties.Settings> <setting name="MySetting1" serializeAs="String"> <value>Value1

Differences between App.Config and Web.Config?

大城市里の小女人 提交于 2019-12-17 15:46:42
问题 when building a desktop app in wpf can you read documentation of problems and safely subsititute 'app.config' when people's answer's refer to 'web.config'? if so are there any glaring GOTCHAS you have to look out for? tnx 回答1: Read the Documentation: Web.config and App.config The choice of the configuration file name is determined by the hosting environment you choose for the service. If you are using IIS to host your service, use a Web.config file. If you are using any other hosting

.NET 3.5 - Configuration system failed to initialize exception

不想你离开。 提交于 2019-12-17 12:13:55
问题 In my winform app, I am trying to add a userSetting, although the error is occuring with appSettings too. When the setting is added I get an exeption thrown that says: "Configuration system failed to initialize" with a Inner Exception "Unrecognized configuration section userSetting" Exception Details: System.Configuration.ConfigurationErrorsException was unhandled Message="Configuration system failed to initialize" Source="System.Configuration" BareMessage="Configuration system failed to

How to modify my App.exe.config keys at runtime?

一笑奈何 提交于 2019-12-17 10:58:21
问题 In my app.config I have this section <appSettings> <add key ="UserId" value ="myUserId"/> // several other <add key>s </appSettings> Usually I access the values using userId = ConfigurationManager.AppSettings["UserId"] If I modify it using ConfigurationManager.AppSettings["UserId"]=something , the value is not saved to the file, and next time I load the application, it uses the old value. How can I change the value of some app.config keys during runtime? 回答1: System.Configuration

How to modify my App.exe.config keys at runtime?

夙愿已清 提交于 2019-12-17 10:58:16
问题 In my app.config I have this section <appSettings> <add key ="UserId" value ="myUserId"/> // several other <add key>s </appSettings> Usually I access the values using userId = ConfigurationManager.AppSettings["UserId"] If I modify it using ConfigurationManager.AppSettings["UserId"]=something , the value is not saved to the file, and next time I load the application, it uses the old value. How can I change the value of some app.config keys during runtime? 回答1: System.Configuration

Encrypting connectionStrings section - utility for app.config

。_饼干妹妹 提交于 2019-12-17 09:33:45
问题 Is there a utility that will encrypt a named configuration section (or just the connectionStrings section) in an app.config file in a similar manner that one can use aspnet_regiis with web.config files? I know this can be done in code - there are code examples out there, but I am hoping to avoid writing an application for this. 回答1: You can try the following: https://magenic.com/thinking/encrypting-configuration-sections-in-net In short - rename the app.config file to web.config - the schema

How can I read/write app.config settings at runtime without using user settings?

五迷三道 提交于 2019-12-17 06:37:04
问题 I'm looking for a way to store application or machine level settings that can be written to at runtime using Application Settings. User settings allow read/write but application settings do not. I have been using user settings for saving settings like this at runtime but this has really proven to be impractical for the following reasons: All users of the machine need to share settings. In support calls (especially in crisis situations) it is difficult to explain to users/employees where to

Can a unit test project load the target application's app.config file?

梦想的初衷 提交于 2019-12-17 05:38:04
问题 I am unit testing a .NET application (.exe) that uses an app.config file to load configuration properties. The unit test application itself does not have an app.config file. When I try to unit test a method that utilizes any of the configuration properties, they return null . I'm assuming this is because the unit test application is not going to load in the target application's app.config. Is there a way to override this or do I have to write a script to copy the contents of the target app

Deploying and Configuring ODP.NET to work without installation with Entity Framework

隐身守侯 提交于 2019-12-17 05:33:20
问题 How do you deploy and configure ODP.NET to work without installation with Entity Framework? A. How to deploy and configure Oracle.DataAccess.Client? B. How to deploy and configure Oracle.ManagedDataAccess.Client? C. What do you need to do in order to make builds with EDMXs with Oracle SSDLs work? D. What do you need to install for designer support? 回答1: This answer summarizes (hopefully) all the steps required, many of which documented in various places online and might save someone hours of