I am trying to clean up our web.config file such that per-deployment specific stuff is not kept in the main config. I have managed with the connections strings and some of the mailSettings, but I need the from attribute as well as the configSource, but this doesn't seem to be allowed.
I 'm trying to connect to the database in file settings.web but displayed error. What's wrong?
web.config: [Code]....
An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately. Parser Error Message: The format of a configSource file must be an element containing the name of the section.
Detailed Error Information Module IIS Web Core Notification Unknown Handler Not yet determined Error Code 0x80070032
Config Error The configuration section 'connectionStrings' cannot be read because it is missing a section declaration Config File \?C:inetpubvhostscno-o.comhttpdocsweb.config
I have splitted the appSettings from web.config file and put it under 'App_ConfigappSettings.config' which is mapped using configSource attribute.web.config :
[Code]....
It is working fine in my local machine. But giving problem while hosting the application to web server.i.e, Can not find appsettings
I have this error: The configuration section 'connectionStrings' cannot be read because it is missing a section declaration on my site when loading this page [URL]. The rest of the site works [URL] Setup:The server is a hosting company - Mocha Hosting. [URL] contains a phpbb forum. This has been installed via the hosting company's web tool (Plesk). There is a root web.config, but there isn't in the /forum/ folder. The forum folder has been set by the phpbb installation wizard to be a virtual directory and application - and it appears to not have asp.net configured on it. The forum worked BEFORE uploading the root web.config file, and again if i temporarily remove the root web.config.
My system: I have installed Windows 7, VS2010 and .NET40 and ASPAJAXExtSetup.msi I'm getting the error below.
Error Summary. HTTP Error 500.19 - Internal Server Error The requested page cannot be accessed because the related configuration data for the page is invalid.
I am getting this error on a website. does that mean the server is not competible with asp.net 3.5
Configuration Error Description:An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
Excuse me this common error. I´ve found a lot of info in Google but I´ve not found my error. I´m trying to read some data from a custom section in web.config and I don´t know which is my error?
I could also write every validation for each object separately, I have only a few elements who uses a required validation but it would be nice that I could do this in one shot instead of repeating the $("input").rules("add .....
This is annoying, because I have to apply this style to every single thumbnail image individually, when there could be any number of them on the screen at any given time. All of the thumbnails are inside a single <div> that groups them together, and I'd like to apply a single style to the <div> that will push the attributes I need down to all of the the <img> elements nested inside, regardless how many thumbnails there are.
I've created a custom config section for my application. For some reason Visual Studio 2010 isn't picking up and of my custom properties. I'm getting warnings similar to this for all the "add" keys: Could not find schema information for the element 'urlFilterSection'
CONFIG FILE: <configSections> <section name="urlFilterSection" type="BotFinderApp.Models.UrlFilterSection, BotFinder" /> </configSections> <urlFilterSection> <urlFilterCollection> <add url="urlhere.com.au" numberOfIpsToExtract="10" /> <add url="urlhere.com.au" numberOfIpsToExtract="10" /> <add url="urlhere.com.au" numberOfIpsToExtract="10" /> <add url="urlhere.com.au" numberOfIpsToExtract="10" /> <add url="urlhere.com.au" numberOfIpsToExtract="10" /> <add url="urlhere.com.au" numberOfIpsToExtract="10" /> <add url="urlhere.com.au" numberOfIpsToExtract="10" /> <add url="urlhere.com.au" numberOfIpsToExtract="10" /> <add url="urlhere.com.au" numberOfIpsToExtract="10" /> </urlFilterCollection> </urlFilterSection> UrlFilterSection: namespace BotFinderApp.Models { public class UrlFilterSection : ConfigurationSection { public UrlFilterSection() { } [ConfigurationProperty("urlFilterCollection", IsDefaultCollection = false)] [ConfigurationCollection(typeof(UrlFilterCollection), AddItemName = "add", ClearItemsName = "clear", RemoveItemName = "remove")] public UrlFilterCollection Urls { get { var urlsCollection = (UrlFilterCollection)base["urlFilterCollection"]; return urlsCollection; } } } } UrlFilterCollection namespace BotFinderApp.Models { public class UrlFilterCollection : ConfigurationElementCollection { public UrlFilterCollection() { } protected override ConfigurationElement CreateNewElement() { return new UrlFilter(); } protected override object GetElementKey(ConfigurationElement element) { return ((UrlFilter)element).Url; } } } UrlFilter namespace BotFinderApp.Models { public class UrlFilter : ConfigurationElement { public UrlFilter() { } [ConfigurationProperty("url", DefaultValue = "", IsRequired = true)] public string Url { get { return (string)this["url"]; } set { this["url"] = value; } } [ConfigurationProperty("numberOfIpsToExtract", DefaultValue = "0", IsRequired = true)] public int NumberOfIpsToExtract { get { return (int)this["numberOfIpsToExtract"]; } set { this["numberOfIpsToExtract"] = value; } } } }
Why do I get a different address from the one defined in web.config?
UPDATE: The "/VNK/site/" prefix is not a problem here. The problem is that LoginUrl property of FormsAuthentication class does not reflect the value from web.config. It means that if I change in web.config loginUrl from "~/Account/LogOn" for example to "~/foobar", FormsAuthentication.LoginUrl still has value of "/VNK/site/Account/Login". Why ?
I'm trying to implement Approach 3 from this Url Rewriting article.I've added all the required configuration (in web.config for the UrlRewriter module) but when i try to add this in web.config:
I have been using the aspnet_regiis to encrypt my web configs in .net 2.0. I have recently moved my application to .net 4 and the encryption runs without any issues but when I try to view the site, I get a 500.19 error "Configuration section encryption is not supported".
I have verified that my web config contains "<validation validateIntegratedModeConfiguration="false" />"
Using VS 2010, RC, VB, how do I change the subfolder attributes. When I publish and choose to delete all the files and folders, I have to recreate the security levels for them manually. I assume that I can have Web Config do that for me.
I'm getting an ConfigurationErrorsException when trying to load a custom section from my web.config.
I'm trying to register a custom section in web.config to load it later using a "Section Class". Suppose my section is orderService, and I register it in web.config as shown: <configuration> <configSections> <sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"> </sectionGroup> <section name="orderService" type="orderService"/> </configSections> <orderService available="true" pollTimeout="00:01:00" location="abc"> </orderService> <appSettings></appSettings> <connectionStrings/>
Then I try to load it with:
Configuration config = WebConfigurationManager.OpenWebConfiguration(Request.ApplicationPath); OrderService custSection = OrderService)config.GetSection("orderService"); <== The exception is thrown here (OrderService is a class that inherits from the class ConfigurationSection, and that defines a property for each orderService property, in this case: available, pollTimeout and location)
The exception says: An error occurred creating the configuration section handler for orderService: Could not load type 'orderService'. (my web.config path line 23) Does anybody know what am I doing wrong here? (I got it from the book APress: Pro ASP.NET 3.5 in C#)
I have a custom section in a web application that I am having trouble encrypting. I have written an external .NET program that will encrypt both .NET 1.1 & .NET 2.0 web/app configs.Up until this point in time, I have never had to encrypt any custom sections for either type of application. Anyway, the way I set it up for my web application is I wrote a class library that I import into the web application which allows me to set up and read from the custom section in the web.config. That all works fine... I added the custom section, and the web pages are able to read the values fine.
Why would I be getting this error message ? I have not touched this part of my application ?Error 5 Section or group name 'compilation' is already defined. Updates to this may only occur at the configuration level where it is defined. C:Documents and Settingsk4gp5My DocumentsVisual Studio 2010WebSitesweb.config 6
I have created a custom configuration section in a c# class library by inheriting from ConfigurationSection. I reference the class library in my web application (also c#, ASP.NET), fill in the appropriate attributes and everything works great. The problem starts when I start adding validators.
For example, this property:
[ConfigurationProperty("appCode", IsRequired = true)] public string ApplicationCode { get { return (string)base["appCode"]; } set { base["appCode"] = value; } }
As is it works fine, but as soon as I add this:
[StringValidator(MinLength=1)]
It bombs with the following error:
The value for the property 'appCode' is not valid. The error is: The string must be at least 1 characters long.
I get this error even though a valid appCode value is in my web.config file. If I remove the validator it works perfectly.
I am running a 4.0 environment on my development machine (VS 2010 + .NET4) and my server (2008 SERVER + just installed .NET 40). On my dev environment, I don't get any errors, but with the same web config on the server, I get: Error 500.19 - The configuration section 'system.web.extensions' cannot be read because it is missing a section declaration