web-config

Advanced tasks using Web.Config transformation

邮差的信 提交于 2020-01-19 04:19:46
问题 Does anyone know if there is a way to "transform" specific sections of values instead of replacing the whole value or an attribute? For example, I've got several appSettings entries that specify the Urls for different webservices. These entries are slightly different in the dev environment than the production environment. Some are less trivial than others <!-- DEV ENTRY --> <appSettings> <add key="serviceName1_WebsService_Url" value="http://wsServiceName1.dev.domain.com/v1.2.3.4/entryPoint

Increase the time of asp.net forms Authentication Even I change Time in web.config file its not working

。_饼干妹妹 提交于 2020-01-17 12:38:41
问题 Below is My Web.config File Code I am using forms Authentication. I increased the Time out Time but still its not working with in 2 minutes My Application is Getting log out Automatically Again User had to sign in Again . <?xml version="1.0" encoding="utf-8"?> <configuration> <configSections> <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 --> <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile

Reading value from web.config file?

别说谁变了你拦得住时间么 提交于 2020-01-17 02:27:11
问题 From my DAL, How can i read a connection string from the web.config? 回答1: You can use the WebConfigurationManager to read connection string value from web.config Code Example: using System.Configuration; string connString = WebConfigurationManager.ConnectionStrings["ConnectionString"].ToString(); Make sure you have added the System.configuration reference to your DAL. 回答2: using System.Configuration; static string connectionString = ConfigurationManager.ConnectionStrings["MyConn"]

Reading value from web.config file?

橙三吉。 提交于 2020-01-17 02:27:08
问题 From my DAL, How can i read a connection string from the web.config? 回答1: You can use the WebConfigurationManager to read connection string value from web.config Code Example: using System.Configuration; string connString = WebConfigurationManager.ConnectionStrings["ConnectionString"].ToString(); Make sure you have added the System.configuration reference to your DAL. 回答2: using System.Configuration; static string connectionString = ConfigurationManager.ConnectionStrings["MyConn"]

How can I read the values of the defaultProxy settings from the system.net section in a web.config?

余生颓废 提交于 2020-01-16 05:50:06
问题 I am trying to read the values of my default proxy settings at runtime, but I can't seem to find any way of doing so. There are plenty of related answers on how to set a default proxy (e.g. How to pass credentials in defaultProxy config setting?), but I'm looking for how to read these settings. The reason behind this is that we sometimes turn on the proxy so we can capture traffic on the server with Fiddler, and I want to create a fail-safe that notifies me if someone has accidentally left it

IIS 7 Rewrite web.config serverVariables directive not working in sub folder

[亡魂溺海] 提交于 2020-01-16 05:08:25
问题 I have the following code in my web.config <?xml version="1.0" encoding="UTF-8"?> <configuration> <system.webServer> <rewrite> <rules> <rule name="IP Correction"> <match url="(.*)" /> <serverVariables> <set name="REMOTE_ADDR" value="{HTTP_X-Forwarded-For}"/> </serverVariables> <action type="None" /> </rule> </rules> </rewrite> </system.webServer> </configuration> This works perfectly on the root of my site, however, the rule isn't being triggered in any of the sub folders. 回答1: I figured this

White page with MVC4+ on IIS 7.0

隐身守侯 提交于 2020-01-15 11:29:06
问题 The problem : When creating a new ASP.NET MVC site, when deployed on production or stage, the server returns empty white pages. To develop we use Visual Studio 2012 and the sites are created using the MVC 4 template and we have IIS 7.5 or 8.0 depending on the version of Windows. Production and stage servers are running Windows Server 2008 with IIS 7.0. 回答1: The cause What we found out is that since IIS 7.5 some parts of the web.config are moved into the default configuration. Also, the web

How to check .net website version?

妖精的绣舞 提交于 2020-01-15 11:24:50
问题 i have a website source code in my pc i want to check in which framework it was developed any one guide me? (i.e 2.0,3.5,4.0) according to me it seems to be developed in 3.5 but i am not sure please confirm i have attached web.config file of it. <?xml version="1.0"?><configuration> <configSections> <sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">

Creating Custom Binding programmatically

那年仲夏 提交于 2020-01-15 10:12:30
问题 We need compression in our WCF Web Service and have already found a good solution: http://www.codeproject.com/Articles/53718/Extending-WCF-Part-II There's only one problem. Configuration files are no option. How those Custom Bindings can be created in code? <customBinding> <binding name="ZipBinding" closeTimeout="00:10:00" openTimeout="00:10:00" receiveTimeout="00:10:00" sendTimeout="00:10:00"> <customMessageEncoding innerMessageEncoding="mtomMessageEncoding" messageEncoderType=

Creating Custom Binding programmatically

独自空忆成欢 提交于 2020-01-15 10:07:57
问题 We need compression in our WCF Web Service and have already found a good solution: http://www.codeproject.com/Articles/53718/Extending-WCF-Part-II There's only one problem. Configuration files are no option. How those Custom Bindings can be created in code? <customBinding> <binding name="ZipBinding" closeTimeout="00:10:00" openTimeout="00:10:00" receiveTimeout="00:10:00" sendTimeout="00:10:00"> <customMessageEncoding innerMessageEncoding="mtomMessageEncoding" messageEncoderType=