app-config

Enterprise Library Class Library App.Config

拈花ヽ惹草 提交于 2019-12-13 18:40:57
问题 I have a class library whcih is a Wrapper class for Enterprise Library Logging Application Block. There I kept an App.Config configuration file. Where all the Enterprise Library related configurations are present. Now I refered this Class Library in a ASP.NET Web Application. Problem I am getting is: The ASP.NET Web Application is unable to read the App.Config file to fetch Configuration Information. And I am getting below Exception: 回答1: Config files are per appdomain, not per binary. If you

.Net assembly override the Assembly.GetExecutingAssembly().CodeBase/Location of an external assembly

心不动则不痛 提交于 2019-12-13 08:24:39
问题 I have a reference to an external assembly DLL (say I copy it in c:\project\abc.dll) in the project setting. When I make a call to the exported method from that assembly I get runtime error. Because it is looking for a file abc.ini which is in c:\ABC while the .exe error message saying that it cannot find the abc.ini in c:\project The assembly seems looking for the folder returned by either Assembly.GetExecutingAssembly().CodeBase or Assembly.GetExecutingAssembly().Location for the abc.ini.

How do I alter a .NET application/user settings on installation?

房东的猫 提交于 2019-12-13 07:30:32
问题 In a Windows Service project, with a Project Installer I tried the following: [RunInstaller(true)] public partial class ProjectInstaller : Installer { public ProjectInstaller() { InitializeComponent(); } protected override void OnBeforeInstall(System.Collections.IDictionary savedState) { base.OnBeforeInstall(savedState); Settings.Default.ASetting = "aValue"; Settings.Default.Save(); } protected override void OnAfterInstall(System.Collections.IDictionary savedState) { base.OnAfterInstall

Customized IEnumerable in ConfigurationSection

喜夏-厌秋 提交于 2019-12-13 06:01:44
问题 I need to create a simple customized ConfigurationSection with an IEnumerable inside it. I have read several articles and stackoverflow links, taking this as a simple example: How to create custom config section in app.config? So, I have this config file section inside a Console App: <?xml version="1.0" encoding="utf-8" ?> <configuration> <configSections> <section name="Disk" type="ConsoleApplication1_ConfigurationEnumerable.PathsConfigSection"/> </configSections> <Disk> <Paths> <Path name=

How do I give a connection string to a server on a network?

做~自己de王妃 提交于 2019-12-13 05:13:02
问题 I'm using SQLite so it's only a file, not a server, but here's the plan: Install the application + the physical .sqlite file on a machine and on another machine over the network, let the other user connect to the .sqlite file. So I'd have to share that folder and give it permissions to allow everyone to read and write from it. Here's my App.config: <?xml version="1.0" encoding="utf-8"?> <configuration> <connectionStrings> <add name="ColegioMentorEntities" connectionString="metadata=res://*

Why is the <system.serviceModel> section missing from app.config?

烈酒焚心 提交于 2019-12-13 03:23:40
问题 I'm trying to consume a WCF service. I added a Service Reference, and now I'm trying to call it: BusStopServiceBinding.BusStopPortTypeClient client = new BusStopServiceBinding.BusStopPortTypeClient(); However, I'm getting this error: Could not find default endpoint element that references contract 'BusStopServiceBinding.BusStopPortType' in the ServiceModel client configuration section. This might be because no configuration file was found for your application, or because no endpoint element

How to Change Web service Address at Runtime?

会有一股神秘感。 提交于 2019-12-13 02:40:44
问题 I'm using a webservice in my wpf application. and set it's URL Behavior to Dynamic, so I have an entry in app.config file like below : <MyApp.Properties.Settings> <setting name="MyApp_WebReference_OnlineUsersService" serializeAs="String"> <value>http://192.168.35.28/OnlineUsersService.asmx</value> </setting> </MyApp.Properties.Settings> I need to change server address dynamically, for example from 192.168.35.28 to 192.168.35.26 . Question is : how can I change the contents of <value> tag at

CodeAssassin.ConfigTransform for of arbitrarily named config files

拈花ヽ惹草 提交于 2019-12-13 01:27:35
问题 NuGet packages such as CodeAssassin.ConfigTransform tranform web.*.config or app.*.config to web.*.config.transformed or app.*.config.transformed upon a VS build. However, what if you have config files of form {arbitrary-name}.config ? For example, MyAssembly.dll.config and its transform rulesets MyAssembly.dll.debug.config & MyAssembly.dll.release.config CodeAssassin.ConfigTransform does not appear to work for these file patterns. 回答1: If you look at the target source code it looks quite

C# Configure LoadFromRemoteSources through code not app.config?

浪子不回头ぞ 提交于 2019-12-12 19:22:16
问题 I currently have an app.config with the following config value: <configuration> <runtime> <loadFromRemoteSources enabled="true" /> </runtime> </configuration> So far I have been able to remove everything else out of my app.config and configure things just using pure C# code except the loadFromRemoteSources . Is there a way to enable loadFromRemoteSources through C# code? I understand the pros and cons of having an app.config, but I would prefer not to have one. Thanks! 回答1: I can't find any

Is there a bug with the new Entity Framework 5 in an MVC4 Project with a Data Access Layer and App.Config

扶醉桌前 提交于 2019-12-12 16:10:01
问题 I have been working on this for a week now and have posted a number of questions in the ASP.Net forums but no one is getting back to me. Here is the breakdown. I have an MVC4 project that is layered with two class libraries, one for modeling data and the other for accessing data. In the DAL I have the following: public class GinkysDb : DbContext { public GinkysDb() : base("ginkys") { Debug.Write(Database.Connection.ConnectionString); } public DbSet<User> Users { get; set; } public DbSet