w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Can we modify the authorization section of web.config file on runtime?
From what I know config files are made to not be modified on runtime, but to have a start up configuration for your executable. That's his function. By the way: Editing app.config in execution time using the same App

Categories : Asp Net

Unity section in .config file using Protected Configuration Provider
Figured it out. I was missing this after the save: config.Save(ConfigurationSaveMode.Full); ConfigurationManager.RefreshSection(sectionName);

Categories : C#

Custom App.config section causing configuration load error
The configSections element must be the first child of the configuration element. Try this: <?xml version="1.0" encoding="utf-8" ?> <configuration> <configSections> <section name="ErrorEmailer" type="EmailTester.ErrorEmailer" /> </configSections> <startup> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" /> </startup> <ErrorEmailer> <SmtpServer address="mail.smtphost.com" /> <FromAddress address="from@host.com" /> <ErrorRecipients> <ErrorRecipient address="example@example.com" /> <ErrorRecipient address="example@example.com" /> </ErrorRecipients> </ErrorEmailer> </configuration> Furthermore, you need to put the namespa

Categories : C#

Reading nested configuration section element of same type from web.config file
My advice? Ditch configuration manager and load the config into an XDocument. Say you have a config file shown below: <Settings> <ApplicationSettings> <AppSetting1 Value="Test1" /> <AppSetting2 Value="Test2" /> </ApplicationSettings> <DeviceSettings> <DeviceSetting1 Value="Test3" /> <DeviceSetting2 Value="Test4" /> </DeviceSettings> </Settings> To get a value from it you can load the config into an XDocument: XDocument xdoc = XDocument.Load(@"Path ofile.xml"); Then: String test1 = xdoc.Element("Settings").Element("ApplicationSettings").Element("Appsetting1").Attribute("Name").Value;

Categories : C#

Change .NET configuration at runtime without modifying app.config
Yes, this is possible. Web.config can include sections from other config files. You add them as sections in your web.config. Changing web.config causing web app to restart but changing those children files doesn't. Opening a non web.config file as a configuration object

Categories : Dotnet

what will be the config section when adding a section to web.config?
Do like this <configuration> <appSettings> <add key="don" value="fffT"/> <add key="LD" value="LDAP://n.tt.sg/DC=ttt,DC=xx,DC=exxxx,DC=sg"/> </appSettings> </configuration> Put Key and values inside appSettings Section of web.confing

Categories : C#

I used the Data Source Configuration Wizard to create a connection to an Access database
It looks like you're filling/binding-to individual datatable. If is the case, try setting sorting of that specific table: this.membership_Log_DataSet.Membership_Log.DefaultView.Sort = "Last_Name ASC";

Categories : Sorting

Is there a way to unset a global git config section in a local git config file?
No Git config includes operate: as if its contents had been found at the location of the include directive ref That means you can't override/remove the include itself, as as soon as it's found the contents of the included file are injected/loaded. You can of course override the settings it contains in a more specific config file: # ~/.git.config.team [user] name = name Locally, via git config user.name nic # /some/project/.git/config [user] name = alias Yielding: /some/project $ git config user.name alias /some/project $

Categories : GIT

What is the recommended method of storing EJB configuration? (Java version of app.config/web.config)
There are several ways and depending on what's your deployment structure it may make sense to pick one or another. META-INF/ejb-jar.xml - this is used when the EJBs are inside their own JAR which in turn is part of an EAR. WEB-INF/ejb-jar.xml - this is used when EJBs are part of a WAR. annotations - many configuration options can be specified through annotations on the bean class itself. The above are configurations specific to EJBs. However, some of the resources you mention may be specified in both ejb-jar.xml and web.xml. For reference, try reading the schema file - it's fairly well documented, or something like this.

Categories : Java

How to refer to one configuration variable from other configuration variable inside Config.groovy
You need to declare a variable: def rootVar = 'a' grails.variable1 = rootVar grails.varibale2 = "${rootVar}bc" Or you might be able to do it via a closure (not tested): grails.variable1 = 'a' grails.varibale2 = { -> "${grails.variable1}bc" }()

Categories : Grails

Why does section order matter in the app.config
The order of sections doesn't matter in general, it's only the configSections element that must be first. From MSDN: If the configSections element is in a configuration file, the configSections element must be the first child element of the configuration element. I assume this is because sections need to be declared before they can be used.

Categories : C#

Section-inheritance with Config::IniFiles
I can find no Perl module that implements config inheritance. But it isn't that complicated to write a simple filter that works out the inheritance. Given a HoH, we can resolve the inheritance like below, if we see each entry in the config as a delta: use Algorithm::C3; # must be installed from CPAN sub resolve_inheritance { my $input = shift; my %output; # hash of arrays where the arrays contain all parents my %child_parent_relations = map { my ($c, @p) = split /s*:s*/; $c => [@p, $input->{$_}] } keys %$input; my $get_parents = sub { @{ $child_parent_relations{shift()}[0] } }; my $get_data = sub { $child_parent_relations{shift()}[1] }; # prepare stuff for C3 resolution my $resolution_cache = {}; my $resolve = sub { my $child = shift; Algorit

Categories : Perl

Section types in Config files
Remove the duplicate declaration in the configSections for "appSettings", "system.serviceModel", "startup". They are already declared in the file machine.config installed by the Framework in the appropriate subfolder of C:WINDOWSMicrosoft.Net <?xml version="1.0"?> <configuration> <configSections> <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,Log4Net" /> </configSections> <appSettings> .... </appSettings> <log4net> <root> ..... </root> <appender name="LogFileAppender" type="log4net.Appender.RollingFileAppender"> ..... </appender> </log4net> <system.serviceModel> .... </system.serviceModel> </configuration

Categories : C#

Adding custom section to web.config in ASP.NET 4
following links will help you understand for this. http://www.codeproject.com/Articles/32628/ASP-NET-Custom-Web-Configuration-Section http://www.4guysfromrolla.com/articles/032807-1.aspx Regards,

Categories : Asp Net

Custom rails configuration section
What you're looking for is ActiveSupport::OrderedOptions. It is used by rails internally to set config namespace. It allows to do something like this, in config/application.rb : module MyApp class Application < Rails::Application # ... config.foo = ActiveSupport::OrderedOptions.new config.foo.bar = :bar end end You can then retrieve it the usual way : Rails.configuration.foo.bar If you want this to be environment specific, you also can use it in config/environments/*.rb rather than config/application.rb.

Categories : Ruby On Rails

In Umbraco 6.1.1 MVC 4, how can I do a form post back to a surface controller using a model that inherits from Umbraco's RenderModel?
Ok, I've had no responses to this question but am now in a position to answer it myself. Maybe it was a fundamental oversight, but not that obvious imho, and information on the Umbraco forum etc about inheriting from RenderModel is fairly limited. Essentially the answer, as was my first instinct, is to solve the original exception "No parameterless constructor defined for this object" by providing a paramaterless constructor. The difficulty is working out what to put inside the parameterless constructor for my model, since it inherits from the Umbraco RenderModel which requires an IPublishedContent instance passed to it's constructor. Luckily while browsing around I happened across this post on the Umbraco forum: http://our.umbraco.org/forum/developers/api-questions/40754-Getting-Curre

Categories : Asp Net Mvc

Does .net custom config section elements have to have keys?
No. But to avoid keys you need to do more work. The concrete type KeyValueConfigurationCollection allows easy creation of a configuration collection by setting some properties. To create a more customised collection requires either extending the abstract ConfigurationElementCollection (but this will still be based on the add/remove/clear model as used by <appSettings>. but allowing the element names to be configured but this is still based on ahaving a key value for each member of the collection (this is determined by an override of GetElementKey so does not need to be directly included in the XML). Alternatively you can create you own, completely custom configuration collection by extending ConfigurationElement, but you'll need to do all the work of parsing the child elements yo

Categories : C#

Modify configProtectedData section in .config file
I solved it using XMLDocument: string path = Path.Combine(targetDirectory, applicationExecutableName); XmlDocument xmlDoc = new XmlDocument(); xmlDoc.Load(path); XmlNode node = xmlDoc.SelectSingleNode("configuration/configProtectedData/providers"); node.InnerXml = string.Format("<add CertSubjectDistinguishedName="{0}" CertStoreName="{1}" name="X509ProtectedConfigProvider" type="ProtectedConfigProvider.X509ProtectedConfigProvider, X509ProtectedConfigProvider, Version=1.0.0.0, Culture=neutral, PublicKeyToken=098027505e2ed139" />", certSubject, certStoreName); xmlDoc.Save(path); If anyone knows a better way please post a sample. thanks

Categories : C#

custom section in app.config throws error in c#
I think that you have to specify the assembly name (the name of the EXE or DLL) where the configuration class resides: <section name="BANANA" type="BANANA.Common.WinConfiguration, YOUR_ASSEMBLY_NAME"/>

Categories : C#

Reading configuration section from a restricted appdomain
In fact, ConfigurationSections were defined in a full trust assembly. So the partial trust caller could not read the configuration section, even if the require permission = false was present. I found a workaround, mark the assembly that contains the configuration section definition with this attribute : AllowPartiallyTrustedCallers

Categories : C#

log4net configuration - failed to find section
Nothing seems wrong with defining the section under <configSections>. Try adding [assembly: log4net.Config.XmlConfigurator(Watch = true)] in your AssemblyInfo.cs in the properties folder of your project. This should do the trick in case your configuration is correct under the tag. EDIT : XmlElement log4NetSection = (XmlElement)ConfigurationManager.GetSection("log4net"); log4net.Config.XmlConfigurator.Configure(log4NetSection);

Categories : C#

Umbraco MVC Implementation - View does not depend on Umbraco implementations
No you can't. Simply because all requests pass through a single action. In order to retrieve a path to a CMS-managed page, you need to use the node/content traversal the @Model provides. See here for more details on this. Edit To clarify, the author of the article is suggesting that the Umbraco implementation should be more in line with a traditional MVC implementation with little or no logic in the views. Therefore, any querying of node data should happen prior to the view (e.g. in the Mappers). So this is where you would have to retrieve the links. Umbraco's default MVC implementation forces all requests to go via a single action on a single controller. The author's implementation allows the requests to be shared across one controller per document type - which is better IMO. But it st

Categories : Asp Net Mvc

Modify Custom Config Section Child Element Value
By the look of it, you just need to modify the Value property getter to include your invert logic. I can see no reason why that wouldn't work. You could add another property that gets the raw value as well. [ConfigurationProperty("value", IsRequired = true)] public int Value { get { var result = (ValueElement)this["value"]; return Invert ? result.Value * -1 : result.Value; } }

Categories : C#

Custom Config Section in MVC4 empty values
edited the properties bodies to get data from parent members [ConfigurationProperty("CompanyId", IsRequired = true)] public int CompanyId { get { return (int)this["CompanyId"]; } set { this["CompanyId"] = value; } }

Categories : Asp Net

Custom configuration section in Azure Cloud Service
At this time I do not believe this is possible. There is a post for it on user voice you can vote up: http://www.mygreatwindowsazureidea.com/forums/169386-cloud-services-web-and-worker-role-/suggestions/459944-enable-custom-configuration-sections-in-csdef-cscf. As a way around this you could put configuration into a file that is stored in BLOB storage. On start up, or when it is needed, all instances could then go pull the file to get the configuration. To deal with changes to the configuration you could either have the instances pulling the configuration from time to time as a refresher, or you could tap into the environment changed event in RoleEntryPoint that is used to detect changes to the Service Configuration. Add a setting to the service configuration that is a version number

Categories : Iis

Access section 'applicationSettings' (not 'appSettings') in config file from setup
I apologize for answering my question by myself, since I found the solution right after posting it. This question gave the answer basically: Save and reload app.config(applicationSettings) at runtime I had to use this code, to write to that section 'applicationSettings': // this gets the applicationSettings section (and the inner section 'inoBIBooks.My.MySettings') Configuration config = WebConfigurationManager.OpenWebConfiguration("/" + targetvdir); ConfigurationSectionGroup applicationSectionGroup = config.GetSectionGroup("applicationSettings"); ConfigurationSection applicationConfigSection = applicationSectionGroup.Sections["inoBIBooks.My.MySettings"]; ClientSettingsSection clientSection = (ClientSettingsSection)applicationConfigSection; // set a value to that specific property Setti

Categories : C#

How to create Inherited Member-Type in Umbraco 6.X?
Member objects do not quite work like that in Umbraco. You can not inherited member objects in the same way that you can inherit document types or media types. I would simply create two independent user types here with the properties you require. If you desperately want the inheritance, you could implement your own membership provider or extension to the API, but even then the inheritance would not be visible in Umbraco, only at the code level. In Umbraco the member types would still appear as independent objects. So it seems like little gain.

Categories : Asp Net

Umbraco MediaService / Umbraco MediaItem not saving
To Save media, I found this method with MediaService. However, I think it's possible another method more refined [HttpPost] public JsonResult Upload(HttpPostedFileBase file) { IMedia mimage; // Create the media item mimage = _mediaService.CreateMedia(file.FileName, <parentId>, Constants.Conventions.MediaTypes.Image); mimage.SetValue(Constants.Conventions.Media.File, file); _mediaService.Save(mimage); return Json(new { success = true}); }

Categories : C#

Umbraco - error when using umbraco.library:NiceUrl(...)
Ok I found a solution: I added an extra check to this part: <!-- Return the url --> <xsl:if test="$i = $max"> <xsl:if test="$id != '' "> <xsl:value-of select="umbraco.library:NiceUrl($id)" /> </xsl:if> </xsl:if> this fixed my problem.

Categories : Xslt

Processmodel Configuration in web.config
According to the documentation for the processModel configuration, it is not possible to configure it for an individual application in IIS. The processModel section can be set only within the Machine.config file and affects all ASP.NET applications that are running on the server. Depending on your requirements, you may be able to use the httpRuntime configuration for your specific needs.

Categories : C#

Log4Net : Error creating the web proxy specified in the 'system.net/defaultproxy' configuration section
I found, I think it's a bug in IIS. The problem was I have my website hosted on IIS, in this website, I have an application for my WebServices. My website and my webservices have their own web.config. BUT the listener name was the same on the 2 web.config, so when the value was different, i had the problem above. So to fix it i change the name of the listener : <system.diagnostics> <trace autoflush="true"> <listeners> <add name="textWriterTraceListener2" type="System.Diagnostics.TextWriterTraceListener" initializeData="C: mplog4net.txt" /> </listeners> </trace> name="textWriterTraceListener2" for the webservice and name="textWriterTraceListener" for the website. But the better is to separate them on IIS (I will do thi

Categories : C#

Using paypal SDK and custom configuration not from web.config
You should give your account credentials.change in the following areas. aypalConfig.Add("apiUsername", "***.gmail.com"); paypalConfig.Add("apiPassword", "api password goes here"); paypalConfig.Add("apiSignature", "signature goes here"); paypalConfig.Add("applicationId", "sandbox app id"); Go to your account for developer.Here you will get the required information.

Categories : C#

Symfony override configuration from the app/config.yml
I found solution by adding compiler pass: class OrmResolverCompilerPass implements CompilerPassInterface { public function process(ContainerBuilder $container) { $loader = new LoaderYamlFileLoader($container, new FileLocator(__DIR__.'/../../Resources/config')); $loader->load('orm.yml'); $def = $container->findDefinition('doctrine.orm.listeners.resolve_target_entity'); foreach ($container->getParameter('resolve_target_entities') as $name => $implementation) { $def->addMethodCall('addResolveTargetEntity', array( $name, $implementation, array() )); } $def->addTag('doctrine.event_listener', array('event' => 'loadClassMetadata')); } } And we also need to create orm.yml in the Resources/config dire

Categories : Symfony2

Configuration Manager is not saving in app.config
Well, your problem most likely is that you're looking at the wrong file. Look at the config.FilePath property in the debugger - it will tell you exactly which file you're dealing with here and now. When you run this code in Visual Studio, your code will change the Yourapplication.exe.config inside your projectindebug directory - it will NOT change the app.config in your project directory! So when you run your code - after the config.Save(), have a look at your project's indebug directory and the config file inside there - are those values properly updated?

Categories : C#

How to encrypt web.config section AND deploy to multiple servers with Amazon Elastic Beanstalk
Can you leverage container commands to import private keys? The command will be executed each time the instance is initialized. Once you begin keeping your keys in a persistent store, S3, for example, then autoscaling should not be an issue. Customizing the Software on EC2 Instances Running Windows has more details on container commands.

Categories : Asp Net

Missing HTML Head section from admin system->configuration->Design in magento
If you have added new layout in your cms section . And added Mage/Page module config.xml in local, then also add system xml there.I thing this will work for you. local/Mage/Page/etc/system.xml

Categories : Magento

Could not find endpoint element with name 'xxxxx' and contract 'yyy' in the ServiceModel client configuration section
solved with the following- endptAddress = new EndpointAddress(new Uri("uri"/xxxx"), EndpointIdentity.CreateDnsIdentity("xxxxxx"), addressHeaders); MHSClient serviceProxy = new MHSClient(b, endptAddress); @Guanxi gave me the clue when asking about endpoint address from the config file. Once I created the endpoint address then I could instantiate/create the service using the correct overload; var b = new CustomBinding() as the first argument and for the second argument, the correct endpoint address. complicated - WS-Security - IBM Websphere server interop <-> wcf client within the context of various .NET and Visual Studio implementations of web services... oh my

Categories : C#

Opening a non web.config file as a configuration object
Configuration Changes Cause a Restart of the Application Domain Changes to configuration settings in Web.config files indirectly cause the application domain to restart. This behavior occurs by design. You can optionally use the configSource attribute to reference external configuration files that do not cause a restart when a change is made. For more information, see configSource in General Attributes Inherited by Section Elements. MSDN In your web.config: <system.net> <myconfigSection> <myConfigEntry configSource="MyExtraConfig.config" /> </myconfigSection> </system.net> In your MyExtraConfig.config: <?xml version="1.0" encoding="utf-8" ?> <myConfigEntry> <myConfigValue1 a="1" b="2" c="3" /> <myConfigValue2 d="4"

Categories : C#

Transform Web.config Hibernate configuration VS 2012
The transformation does not happen because the element names differs from your baseline Web.config. If you remove the hib namespace, transformation will take place. <?xml version="1.0" encoding="utf-8"?> <configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform"> <hibernate-configuration xmlns="urn:nhibernate-configuration-2.2"> <session-factory> <property xdt:Transform="Replace" xdt:Locator="Match(name)" name="connection.connection_string">{new_connection}</property> </session-factory> </hibernate-configuration> </configuration> Another thing to note. If your current configuration is Release and you are running your application through Visual Studio, the server will point to the root of your pro

Categories : C#

Config issue in Private_pub and rainbows configuration
For anyone facing the same issue answers are here: https://groups.google.com/forum/#!topic/faye-users/oQ5JCoV7qh8 The issue here was that i was using older version of faye-websocket. Another issue was that I was using rainbows 4.5 while faye[0.8] supported older rainbows

Categories : Ruby On Rails



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.