web-config

Does the appsettings file attribute override what is in the app.config?

有些话、适合烂在心里 提交于 2019-12-20 17:08:47
问题 The appsettings tag in the app.config has a file attribute: <appSettings file="other.config"> .. .. </appSettings> How does this work? Will it merge what is in the appSettings (original) with the other.config file? Or will it overwrite it? What if the other.config file doesn't exist, should it crash? I'm trying it myself and if a key isn't in the original, it doesn't seem to read it from the other.config? Should the other.config file have just xml nodes, or should it all be inside a

InheritInChildApplications attribute not recognized in web.config location element

廉价感情. 提交于 2019-12-20 16:25:12
问题 I've tried wrapping my <system.web> with <location path="." InheritInChildApplications="false"> like this <location path="." InheritInChildApplications="false"> <system.web>...</system.web> </location> But VS 2010 Web Developer Express keeps saying The 'InheritInChildApplications' attribute is not allowed When I run my web app there's an error: HTTP Error 500.19 - Internal Server Error The requested page cannot be accessed because the related configuration data for the page is invalid. Config

web.config, configSource, and “The 'xxx' element is not declared” warning

為{幸葍}努か 提交于 2019-12-20 11:15:29
问题 I have broken down the horribly unwieldy web.config file into individual files for some of the sections (e.g. connectionStrings, authentication, pages etc.) using the configSource attribute. This is working fine, but the individual xml files that hold the section 'snippets' cause warnings in VS. For example, a file named roleManager.config is used for the role manager section, and looks like this: <roleManager enabled="false"> </rolemanager> However I get a blue squiggle under the roleManager

Can I use Web Config Transform without publish with Visual Studio 2012?

时间秒杀一切 提交于 2019-12-20 10:59:56
问题 Does Visual Studio 2012 support running a solution using a specific Web.config transform without the requirement to publish? We are using the web.config to change client settings on publish and want to test them locally. 回答1: The web.config transform feature is only available during publish/package. The deal with this is that web projects don't have the abstraction of an alternate folder where the app executes versus the folder where the source is located like win project have. Because of

Where and how to define <customErrors mode=”on”> for my asp.net MVC 3 web application

北战南征 提交于 2019-12-20 10:58:40
问题 I want to set the custome error to be true to prevent users from viewing detailed info about my application. But I cannot find where I should write this <customErrors mode="on"> ; should it be in the web.config or in the web, debug.config or else where? BR 回答1: From my experience, we should turn custom error to On in release mode and turn it off in debug. To automatically do this, we can use web.config transformation like the following example. Web.Debug.config This setting will allow web

How to specify url mappings in ASP.NET 4.0 when parameters are involved?

冷暖自知 提交于 2019-12-20 04:39:07
问题 The problem I have a web site with some articles inside. Articles are accessed using a database writing results on a single page. When a certain article is to be accessed, I need the article-id and I only need to get to the page: http://www.mysite/Articles.aspx?a={article-id} . This is nice but not really friendly and not scalable. What I want to do is to redirect every url in the form: http://www.mysite/articles/{article-id} to the page http://www.mysite/Articles.aspx?a={article-id} . I know

Web.config Deny access to subfolder recursively

梦想的初衷 提交于 2019-12-20 04:26:07
问题 If I have a sub folder in my website called Admin and this folder has more sub folders. How can I configure a web.config file, that sits in Admin folder, to effect all the subfolders in it recursively? Currently i have this, but it only caters for the admin folder, and doesn't effect the sub folders <location path="Admin"> <system.web> <authorization > <deny users="?"/> <allow roles="Admins"/> </authorization> </system.web> Thanks. 回答1: You need to deny all other users. By default, all users

Error with windows impersonation code in webconfig file

我只是一个虾纸丫 提交于 2019-12-20 03:18:06
问题 I have the following section declared in the webconfig file to allow impersonation , I have shared the folder to public access within the network on the other machine <system.web> <compilation debug="true" targetFramework="4.0" /> <authentication mode="Windows"/> <identity impersonate="true" userName="******" password="*****"/> ......... .......... when i run the application its throwing error saying Configuration Error Description: An error occurred during the processing of a configuration

htaccess is not working on iis

不羁岁月 提交于 2019-12-20 02:32:36
问题 how to convert .htaccess to web.config. I just come to know that I need to use web.config instead of htaccess. Please find my htaccess below RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php/$1 [L] how i can convert it into web.config ? 回答1: copy paste below code in your web.config <?xml version="1.0" encoding="UTF-8"?> <configuration> <system.webServer> <rewrite> <rules> <rule name="Imported Rule 1"

specifying MaxHttpCollectionKeys for a specific page?

时间秒杀一切 提交于 2019-12-19 20:41:12
问题 I am wondering if there is a way to change this value for a particular page, instead of setting it for the entire project. We are running into the limit, but only for a couple pages. Our project is using .NET 3.5. For those who are unaware of what this variable is for, it is to get around this: http://support.microsoft.com/kb/2661403 Essentially if you have a lot of form keys (over 1000), you will get an exception when posting back to the page. You can get around this by specifying in your