web-config

Securing Elmah in ASP.NET website

对着背影说爱祢 提交于 2019-12-17 17:18:59
问题 I am having trouble trying to secure ELMAH. I have followed Phil Haacked's tutorial, with the only difference being the demo project is a web application and my project is a website. <add verb="POST,GET,HEAD" path="/admin/elmah.axd" type="Elmah.ErrorLogPageFactory, Elmah" /> <location path="admin"> <system.web> <authorization> <deny users="?"/> </authorization> </system.web> </location> With the leading "/" I receive the response that "The resource cannot be found.", if I remove the leading "

Configuration file is not well-formed XML #2

≡放荡痞女 提交于 2019-12-17 16:18:58
问题 I'm trying to fix an IIS 7 web server on Windows Server 2008. I don't know what caused this configuration to go bad. Any ideas on where to begin to look? Error when clicking on the server node in the object explorer of IIS Manager. There was an error when trying to connect. Do you want to retype your credentials and try again? Details: Filename: \\?\C:\Windows\system32\inetsrv\config\applicationHost.config Line number: 1 Error: Configuration file is not well-formed XML 回答1: This issue is due

How can I combine the WCF services config for both http and https in one web.config?

流过昼夜 提交于 2019-12-17 15:42:35
问题 I spent a lot of time figuring out how to configure my WCF services so that they would work for https in the production environment. Basically, I needed to do this: <behaviors> <serviceBehaviors> <behavior name="MyServiceBehavior"> <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" /> <serviceDebug includeExceptionDetailInFaults="true" /> </behavior> </serviceBehaviors> </behaviors> <serviceHostingEnvironment multipleSiteBindingsEnabled="true" aspNetCompatibilityEnabled="true" />

Programmatically register HttpModules at runtime

一曲冷凌霜 提交于 2019-12-17 10:21:16
问题 I'm writing an app where 3rd party vendors can write plugin DLLs and drop them into the web app's bin directory. I want the ability for these plugins to be able to register their own HttpModules if necessary. Is there anyway that I can add or remove HttpModules from and to the pipeline at runtime without having a corresponding entry in the Web.Config, or do I have to programmatically edit the Web.Config when adding / removing modules? I know that either way is going to cause an AppDomain

Log4Net “Could not find schema information” messages

孤街浪徒 提交于 2019-12-17 08:55:17
问题 I decided to use log4net as a logger for a new webservice project. Everything is working fine, but I get a lot of messages like the one below, for every log4net tag I am using in my web.config : Could not find schema information for the element 'log4net'... Below are the relevant parts of my web.config : <configSections> <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" /> </configSections> <log4net> <appender name="RollingFileAppender" type="log4net

Log4Net “Could not find schema information” messages

烂漫一生 提交于 2019-12-17 08:55:04
问题 I decided to use log4net as a logger for a new webservice project. Everything is working fine, but I get a lot of messages like the one below, for every log4net tag I am using in my web.config : Could not find schema information for the element 'log4net'... Below are the relevant parts of my web.config : <configSections> <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" /> </configSections> <log4net> <appender name="RollingFileAppender" type="log4net

how to add files in web.config transformation process?

拟墨画扇 提交于 2019-12-17 08:52:45
问题 I am having a website developed in Visual Studio 2012. The web.config is currently containing following files in its transformation: - web.Debug.config - web.Release.config I have recently added a new build configuration (named as "Staging") in my project. How can I create a "web.Staging.config" transformation file? 回答1: There are two ways for the web.config transform files to be generated within VS: If you have a web application project, Right-click on web.config and choose Add Config

How do I use Web.Config transform on my connection strings?

落花浮王杯 提交于 2019-12-17 06:12:19
问题 In my current project, I have some connection strings that are valid for local development machines: <configuration> <connectionStrings> <add name="ApplicationServices" connectionString="Data Source=localhost;Initial Catalog=MyDB;Integrated Security=SSPI" </connectionStrings> .... </configuration> How would I use the Web.Config transforms to convert from this expression to one valid for our production server? The production server one would look something like: <configuration>

How can I secure passwords stored inside web.config?

烂漫一生 提交于 2019-12-17 04:31:28
问题 I have added the following settings inside my web.config file to initiate an API call to external system. So I am storing the API URL + username + password as follows:- <appSettings> <add key="ApiURL" value="https://...../servlets/AssetServlet" /> <add key="ApiUserName" value="tmsservice" /> <add key="ApiPassword" value="test2test2" /> Then inside my action method I will be referencing these values when building the web client as follows:- public ActionResult Create(RackJoin rj,

Reading web.config from JavaScript

核能气质少年 提交于 2019-12-17 04:30:12
问题 IS there any way that I can read config values in web.config with javascript ? Why would I want to do that ? I have a timer in my website which would pop up a modal dialog with a count down timer (count down for 2 minutes) if the user is inactive for 20 minutes. If the user does not respond, it logs him out. If he does, it pings to the server (to maintain the session) and keeps the session alive This 15 minutes is hardcoded in the js file. I would rather want to pick it up from a config file