app-config

app.config dependentAssembly not working

谁都会走 提交于 2021-01-27 04:06:53
问题 I would like to directly link to Dlls that are used at compile/runtime. My program layout is this: Console Exe launches a winform dll. That dll uses a bunch of dlls to perform. The Appconfig is located in the project of the winform dll. Based on some reading, is the winform dll looking for the wrong app.config? I am intending on executing my dll using Assembly.LoadFrom(); I created an app.config file and added the following lines inside the section <runtime> <assemblyBinding xmlns="urn

app.config dependentAssembly not working

走远了吗. 提交于 2021-01-27 04:06:31
问题 I would like to directly link to Dlls that are used at compile/runtime. My program layout is this: Console Exe launches a winform dll. That dll uses a bunch of dlls to perform. The Appconfig is located in the project of the winform dll. Based on some reading, is the winform dll looking for the wrong app.config? I am intending on executing my dll using Assembly.LoadFrom(); I created an app.config file and added the following lines inside the section <runtime> <assemblyBinding xmlns="urn

app.config dependentAssembly not working

你。 提交于 2021-01-27 04:06:28
问题 I would like to directly link to Dlls that are used at compile/runtime. My program layout is this: Console Exe launches a winform dll. That dll uses a bunch of dlls to perform. The Appconfig is located in the project of the winform dll. Based on some reading, is the winform dll looking for the wrong app.config? I am intending on executing my dll using Assembly.LoadFrom(); I created an app.config file and added the following lines inside the section <runtime> <assemblyBinding xmlns="urn

How to persist app.config through ClickOnce updates using ConfigurationManager?

◇◆丶佛笑我妖孽 提交于 2020-07-05 08:18:30
问题 This question describes my problem exactly, except I'm using a custom configuration section in app.config with ConfigurationManager , so the solution presented there doesn't apply... Basically, my problem is that when ClickOnce updates the application, it installs into a different directory with the new app.config, thereby erasing any changes made. My application uses app.config to persist application settings, so this is very bad... a merged update would be excellent (similar to what is

System.Configuration.ConfigurationManager.ConnectionStrings retrieves old value at runtime

梦想的初衷 提交于 2020-05-30 11:41:19
问题 In my dotnetcore winforms application I am able to get the connection string correctly from app.config when running in the IDE var connectionString = System.Configuration.ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString; For run time, I thought I would just replace the connection string in the MyApp.Win.config file. However the connection string is being pulled from MyApp.Win.dll.config The docs are here. 来源: https://stackoverflow.com/questions/61845150/system

How to check if Configuration Section exists in .NET Core?

泪湿孤枕 提交于 2020-05-28 14:01:13
问题 How can you check if a configuration section exists in the appsettings.json in .NET Core? Even if a section doesn't exist, the following code will always return an instantiated instance. e.g. var section = this.Configuration.GetSection<TestSection>("testsection"); 回答1: Query the children of Configuration and check if there is any with the name "testsection" var sectionExists = Configuration.GetChildren().Any(item => item.Key == "testsection")); This should return true if "testsection" exists,

How to check if Configuration Section exists in .NET Core?

送分小仙女□ 提交于 2020-05-28 14:00:50
问题 How can you check if a configuration section exists in the appsettings.json in .NET Core? Even if a section doesn't exist, the following code will always return an instantiated instance. e.g. var section = this.Configuration.GetSection<TestSection>("testsection"); 回答1: Query the children of Configuration and check if there is any with the name "testsection" var sectionExists = Configuration.GetChildren().Any(item => item.Key == "testsection")); This should return true if "testsection" exists,

Excel-DNA Add-In with connection strings stored in external configuration file

牧云@^-^@ 提交于 2020-02-25 06:56:28
问题 I'm using Excel-Dna in a project where connection strings are stored in an external file called connections.config , which is referenced in the App.config file. When building the project, both config files are copied to the bin folder and the App.config file is renamed <Name>-AddIn64-packed.xll.config as it should be. The problem is that the packed xll still relies on both config files. Everything works fine when including the connection strings directly in the App.config , but I need to keep

Encrypted config file does not work for Windows Service

让人想犯罪 __ 提交于 2020-02-24 13:26:11
问题 I am encrypting my app.config via the "aspnet_regiis -pef" approach. Encryption and decryption work fine. If I decrypt the config file, the service runs fine. When I encrypt two sections of the config (via above method), the service refuses to start, w error below. But at run time, the framework throws a ton of "exception while reading config..." errors (below). I thought .config encryption was transparent to .NET apps generally? (under IIS, cmd line, etc.) I can make the error come and go by