app-config

Changing app.configuration file during installation process with visual studio installer fails: Could not load file or assembly 'EntityFramework'

馋奶兔 提交于 2019-12-23 05:24:02
问题 Project Info: We are creating an installer project that allows users to choose a servername and databasename. After installation of the main program a corresponding database will be created. Installer project : Has an additional UI screen with two textboxes, containing servername and databasename. An custom action will be executed on installation and has the servername and databasename defined as custom action data. Main application: An installer class wires the after-installation event. This

Storing database settings outside app.config

主宰稳场 提交于 2019-12-23 05:13:49
问题 I've been writing a c# exe that will be running on a live web server, but I want to be able to test it on our staging server. Since the staging server has different database settings (in the app.config) from my localhost, is there any way I can store the connection string outside the app.config so that I can easily get to it? Also, is it possible to store the database connection string, then access it via the app.config? This might sound odd, but I'm using a dll from a CMS that uses the value

ClickOnce and configuration for a C# application

白昼怎懂夜的黑 提交于 2019-12-23 03:22:42
问题 What and how should I put into an app.config file. The scenario is this, I have created a C# Windows Forms application (.NET 4.0), and it runs fine on the development computer. When I deploy it using ClickOnce on other computers I get a permission error for the machine.config file. This is a corporate domain so I do not have rights to change the permissions in the machine.config file on the target computers. From what I have been reading, I believe that whatever is being accessed in the

C# Changing DLL app.config depending on consumer

◇◆丶佛笑我妖孽 提交于 2019-12-23 02:54:23
问题 I have a Class Library project containing some basic logic. The DLL created by this project will be used in a few other projects. I have a app.config file in the Class Library project with a couple of values the DLL uses. When each consumer project will use the DLL, it has to change the values in the app.config For example, if my DLL's app.config contains 3 settings: A, B, C, then: The first consumer of the DLL will have A="a", B="aa", C="aaa" . The second consumer of the DLL will have A="t",

In SOAP message to WCF web service, how to put KeyIdentifier directly inside SecurityTokenReference (inline, without using Reference token)

女生的网名这么多〃 提交于 2019-12-23 01:41:55
问题 I'm successful in communicating with a WCF service via SoapUI (I was given specification on how to configure it), but I'm having trouble in copying those settings to .NET application. Turns out the shape of generated SOAP message (peeked via Fiddler) is being rejected by the web service, who expects a stricter layout of envelope. I'm very close. On this picture... ... you can see three SOAP messages: 1. With X509SecurityTokenParameters.InclusionMode set to AlwaysToRecipient 2. With

What is the equivalent of an app.config in a WinRT app?

北战南征 提交于 2019-12-22 18:34:12
问题 In windows desktop development (WinForms, WPF), the app.config is a potential place to put things like connection strings or uri's used within the app. This allows the end user to change these settings, application wide, without having to have a developer rebuild and redeploy. Is there a similar concept in WinRT apps? The closest thing I see is there is the local application data: http://msdn.microsoft.com/en-us/library/windows/apps/hh700361.aspx The trouble I am having is that it seems like

Azure role configuration management

泪湿孤枕 提交于 2019-12-22 06:59:32
问题 I don't see how Windows Azure lets you vary the configuration of an application when you have no choice but to hold configuration settings in web.config (or app.config). For example... Quite often projects will make use of a 3rd party library that makes heavy use of web.config. The use of web.config may involve connection strings, app settings or custom configuration sections. A good example of this is ELMAH. A web.config file for ELMAH might look like the following: <configuration>

WCF: Updating Service Reference gives duplicate config entries

穿精又带淫゛_ 提交于 2019-12-22 06:56:42
问题 I have a WPF application using service references to a WCF service. When doing updates on the service I need to update the service reference, so I right click it and hit "Update Service Reference". Doing this results in duplicate entries in the App.config file of the client project. It duplicates a binding under wsHttpBinding - adding an equal entry with postfix number in name: WSHttpBinding_ISomeService --> WSHttpBinding_ISomeService1 . And it duplicates the endpoint definition under binding

.NET ConfigurationManager app.config confusion

我与影子孤独终老i 提交于 2019-12-22 06:37:30
问题 I've got an app.config file, which contains the following <?xml version="1.0" encoding="utf-8" ?> <configuration> <configSections> <section name ="PowershellSnapIns" type ="System.Configuration.DictionarySectionHandler,System"/> </configSections> <PowershellSnapIns> <add key="SnapIn1" value="WebAdministration" /> <add key="SnapIn2" value="Jimmy Hendrix" /> <add key="SnapIn3" value="..." /> </PowershellSnapIns> </configuration> I was going to use the ConfigurationSettings class to read it, but

App.Config vs Custom XML file

淺唱寂寞╮ 提交于 2019-12-22 05:29:07
问题 I have read a lot of statements like " you shouldn't clog your app.config file with custom settings ". However, I was under the impression that this was exactly the purpose of the file? Is it just indeed a preference thing? Or are there any real benefits (other than separation of settings) by using a custom XML file, as apposed to the app.config file? If you need to explicitly separate settings would it better to use a custom ConfigurationSection rather than opting for a custom XML file? I