web-config

debugging while uploading large file in ASP.NET

I've checked many threads about this but I'm not sure how to fix this: When I try to upload a 33 mb file while debuggin, control directly falls into application_endrequest even when I've a breakpoint set to first line in application_beginrequest in my global.asax.cs. I can see the page in non-postback case. My maxRequestEntityAllowed i...

Web.Config file corrupting on publish

So I've just started up my most recent website: http://EpicClanWars.com and it would seem that every 5th or 6th time I publish my project out of VS 2005 the Web.Config file corrupts and loses its connection string to the database and a nasty exception gets thrown stating that the web.config file does not contain the connection string th...

Check httpErrors errorMode programatically

How do I get the value of the errorMode property set in the <system.webServer><httpErrors> element in web.config? I'm trying to implement some "self-diagnostics" in an ASP.NET web application. When the app starts, it runs through some of the settings in web.config and confirm they're set correctly. While this code works quite nicely wh...

Redirect *.domain.com & domain.com to www.domain.com

I've got an Search Engine Optimisation problem where users are able to access my site by specifying any sub-domain. This is causing duplicate page issues with SEO. For example if a user mis-types 'www' then posts a link on a forum, google is crawling 'wwww.domain.com'. Furthermore, google is also crawling 'domain.com'. I need a way of ...

Location access in ASP.NET

I have admin area of my site: http://www.mysite.com/webadmin and I want to protect it by role (I'm using ASP.NET forms auth), so that only a user with the role "admin" could access it. In web.config I added this entry: <location path="WebAdmin"> <system.web> <authorization> <deny users="*"/> <allow r...

Storing a variable collection of strings in Web.Config?

I would like to store a collection of strings in the web.config. This collection would vary in size over time. I would like to be able to pull all of the strings in the collection into an array or collection in code. (.Net 4, asp.net) i.e. <customCodes> <VendorCode vendorName="Name1" code="1234567891234567891324567987ddd" isActive="tru...

Is there a performance penalty for storing values in the web.config compared to const fields?

Hello, currently in our application we have an ApplicationConfiguration class. It is basically just a static class with const values specifying certain application-global configuration options. Some of these values will rarely if ever change and are only put into the configuration for elegance/cleanness. Some of these values though do ...

PROGRAMMING ISSUES

I am having issues accessing my ConnectionString in the web config. Here is my web config. <configuration> <appSettings/> <connectionStrings> <add name="UAFConnectionString" connectionString="Provider=SQLOLEDB;Data Source=INLISAP003;Password=5q1server2005;User ID=sa;Initial Catalog=UserAccessForm" providerName="System.Data.Ole...

Remove BOM from page output via web.config

Currently our pages are being output with the Unicode BOM. I have found one way of removing this by adding the following to my masterpage's OnInit. Response.ContentEncoding = System.Text.UTF8Encoding(false); Where the false being passed to the UTF8Encoding constructor disables the BOM. This works fine, but I'd prefer to set this in...

Web.config Transforms add extra line returns where there are none

When my Web.config transforms it is adding a new line before the end value tag in my ApplicationSettings. This new line is showing up in the setting and causing an exception. Example: Web.config: <setting name="FilePath" serializeAs="String"> <value>c:\path</value> </setting> Web.Debug.config: <...

How to include dynamic information in Sharepoint master page?

We are creating several (19) sites to be hosted in Sharepoint 2007 and want to use Google Analytics. The first bit was easy, simply putting the Google Analytics javascript in the Sharepoint master page and all worked as expected. However, we want each of the 19 sites to generate seperate statistics and this is done by having a different...

Web.config transformation causing an error when building

I am using the new VS2010 Web.config transformation. When i do a publish under the 'Release' solution configuration, i get a folder created called ..obj\Release\TransformWebConfig, which contains the original Web.Config and the transformed Web.Config, in addition to If i was to then try to re-build my solution using the same 'Release'...

How do I secure WCF services for website and mobile device using membership provider?

My question is a bit specific. I am currently hosting WCF services that provide data to a website (JQuery) and a mobile application (iphone). I want to secure this communication using a Membership Provider. I know how to setup the membership provider to secure the services so the Jquery part of the story is complete. However I need ...

ASP.NET-4 IIS7.5 web.config serverRuntime element

Whenever I add this line to my web.config in the system.webServer section: <serverRuntime /> With our without properties, IIS 7.5 just serves up a blank page instead of the website. I created a new empty Web Application using IIS and added the line to the web.config; blank page. What am I doing wrong? ...

"Baseaddress not found"-error when deploying WCF service on GoDaddy.

Hi, I'm trying to deploy a WCF-service, but I'm having dificulties getting the final bits to work. I'm not a deployment guru in any way, so please bear with me. I'm using a WebHttpBinding to make Ajax calls to the service using JSON, but I receive the error: "Could not find a base address that matches scheme http for the endpoint with ...

Web.config Location element functioning incorrectly

Hi, Environment: ASP.NET 3.5, C#, Forms Authentication, IIS 6 Problem details: I have a web.config file set up with forms authentication and the following are the location element, as appearing: <location path="Home/Common"> <system.web> <authorization> <allow users="*" /> </authorization> </system.web> <...

Microsoft Chart Controls Assembly reference: howto move it to web.config

Currently, when I want to use Microsoft Chart Controls on a website, I need to add the following onto every aspx page where I want to use it: <%@ Register Assembly="System.Web.DataVisualization, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" Namespace="System.Web.UI.DataVisualization.Charting" TagPrefix="asp" %> ...

Make Web.config transformations working locally

I want to get web.config transformations working locally but apparently the transformations only occur when doing deployments. Does anybody know of a way to run the msbuild target "TransformWebConfig" without it going through the "rebuild" process and also specify and output directory where to spit out the transformed web.config? -Die...

How can I see the exception call stack in SharePoint 2010?

I am trying to port a SharePoint 2007 site collection feature to 2010. During the feature activation, SharePoint shows the "yellow screen of death" stating "The current custom error settings for this application prevent the details of the application error from being viewed.". AFAIK I have configured everything that is need to see the e...

Weird behavior on ASP.NET application after switching sessionState to cookieless="UseUri"

Hello, So I have an asp.net application that is having the not so unusual session problems on Internet Explorer 8 and tabs that has been discussed extensively here. http://stackoverflow.com/search?q=asp.net+session+IE+tabs Now, one solution that I wanted to try was to use the cookieless session state, so I added this line to my web.con...