web-config

How to override HttpErrors section in Web.Config - ASP.NET MVC3

房东的猫 提交于 2019-12-21 03:58:22
问题 I am trying to add custon 404 pages as per answer of this question ASP.NET MVC 404 handling and IIS7 <httpErrors> by adding <httpErrors existingResponse="PassThrough" /> under <system.webServer> tag in my Web.Config file. But I am getting following error Module: CustomErrorModule Notification: SendResponse Handler: System.Web.Mvc.MvcHandler Error Code: 0x80070021 Config Error: This configuration section cannot be used at this path. This happens when the section is locked at a parent level.

web.config errors fail with responseMode=“File”

浪子不回头ぞ 提交于 2019-12-21 03:58:07
问题 According to Microsoft's documentation, for static (i.e. HTML) content, web.config should read responseMode="File" for each error. Currently, my web.config includes <httpErrors errorMode="Custom"> <!-- remove statusCodes --> <error statusCode="404" path="/error/404.html" responseMode="ExecuteURL" /> </httpErrors> This returns the correct custom error page, but returns a 200 OK status code. When I change "ExecuteURL" to "File", my server does return a 404, but the custom error page is not

Could not load file or assembly “Microsoft.Web.Extensions”

ε祈祈猫儿з 提交于 2019-12-21 03:33:13
问题 I've inherited an asp.net 3.5 solution and I'm having trouble getting it working. I keep receiving the error: Could not load file or assembly 'Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified. (c:\mydir\web.config line 54) Now, I've had a good look around Google and have seen that people have said to run a simple search and replace to change "Microsoft.Web. " to "System.Web. "

ASP.NET web.config: What is the default for the debug attribute in system.web.compilation?

孤街醉人 提交于 2019-12-21 03:23:22
问题 If I don't include the debug attribute in the compilation element like this: <system.web> <compilation /> </system.web> Does it default to true or false ? Links to sources would be appreciated. 回答1: The default for debug attribute in the compilation is false MSDN - compilation Element (ASP.NET Settings Schema) debug Optional Boolean attribute. Specifies whether to compile debug binaries rather than retail binaries. The default is False. 回答2: The default value is false, but beware of ASP.NET

Adding a custom hashAlgorithmType in C# ASP.NET

扶醉桌前 提交于 2019-12-21 02:54:30
问题 I've got a page that I need to beef up security on. I'm using the built-in MembershipProvider functionality and currently have hashAlgorithmType set to SHA512. I've got the BCrypt.NET library (http://bcrypt.codeplex.com/) and it seems to be working nicely when I call its functions from code but I'm having the worst time figuring out how to create the appropriate <cryptographySettings> section in Web.config to let me create a hashAlgorithmType . I found the following code snippet on the web:

windows authentication session timeout

不问归期 提交于 2019-12-21 02:31:09
问题 I have this code in my web.config: <system.web> <authentication mode="Windows" /> <sessionState timeout="300" /> </system.web> Even though sessionstate timeout is 300. It just expires in 15-20 mins and session data is lost. My Application pool and everything has correct timeout set of 300 minutes. So I believe problem is with Windows authentication only. Secondly, if I just disable the Windows authentication and remove that line, it all works out fine (i.e my session data is preserved for

SoapExtension not loading

 ̄綄美尐妖づ 提交于 2019-12-21 01:13:30
问题 I'm trying to write a soap extension. But the framework is not loading it. I've added to the web.config <webServices> <soapExtensionTypes> <add group="High" priority="1" type="Lisa.Admin.SoapExceptionExtension,Lisa.Admin" /> </soapExtensionTypes> </webServices> and even if I change the type to some bullshit It does not cast an exception. 回答1: I have been having a problem with similar behaviour but I don't know if it's exactly the same. When writing, compiling and applying my SoapExtension, in

Transforming included configuration files using configSource

旧巷老猫 提交于 2019-12-20 23:27:11
问题 This question is kind of a two parter. In VS2015 my MVC project has multiple different build configurations, Test, UAT, Live etc. With my web.config I can simply right click it and select Add Config Transform to create the transform files for each build configuration. If I have an external config file, such as Log4Net.config how can I configure this to have dependant transforms like web.config ? Is this done manually by editing the project.csproj file ? Secondly, I have a web.config file thus

Single Connection String with Multiple Entity Framework Models?

寵の児 提交于 2019-12-20 20:18:07
问题 At work we currently have a very large web application with a connection to a massive database. We have been using Entity Framework for a while now and to make things easier we divided the database into many Entity models. This works well for us but we ran into an issue. Each EF model needs its own connection string due to the metadata part of the connection string. Managing so many connection string is a pain. Now I have a solution that I think will work. I am going to create a class that

Can someone point me to a really easy to understand guide to web.config?

杀马特。学长 韩版系。学妹 提交于 2019-12-20 17:19:11
问题 I'm really interested in gaining an in-depth understanding of the format and structure of the web.config file for ASP.NET web development. I'd like to know if there's some really easy to comprehend material (apart from the MSDN docs) which can provide me a ground-up understanding of the web.config file and its different sections. Any suggestions? 回答1: This is a really good article: The Web.Config Demystified It takes the magic out of the Web.Config... which after all is just an XML file. Best