web-config

Is there Any Way to Set the Namespace of a Web Service in Configuration instead of Code?

Currently we're using in code <System.Web.Services.WebService(Namespace:="https://ourservice/")&gt; to set the namespace, can this be done in web.config, instead? I've looked but can't find where? VS2008, ASMX web service. ...

How to set the "weak password" error strings of a membership provider?

I have a membership provider in my web.config with the passwordStrengthRegularExpression attribute set. I dropped an asp:CreateUserWizard in a page and tried to create a user with a weak password (ie didn't match the regex in the web.config). The validation fails and displays the message Password length minimum: 7. Non-alphanumeric ...

WCF service dataContractSerializer maxItemsInObjectGraph in web.config

I am having issues specifying the dataContractSerializer maxItemsInObjectGraph in host's web.config. <behaviors> <serviceBehaviors> <behavior name="beSetting"> <serviceMetadata httpGetEnabled="True"/> <serviceDebug includeExceptionDetailInFaults="True" /> <dataContractSerializer maxItemsInObjectGraph="214748364...

How to apply VS2010 web.config transformation to an element with a namespace attribute?

I'd like to use the new VS2010 web.config transformation feature to change the connection string within the nhibernate configuration in my web.config file. The relevant snippet is something like this: <?xml version="1.0"?> <configuration> <configSections> <section name="hibernate-configuration" type="NHibernate.Cfg.ConfigurationSe...

ASP.NET user database without web.config connection strings

Hi, I'm wondering whether it's possible to use built in ASP.NET application services (aspnet_user, aspnet_role etc table) without specifying a connection string in a web.config. At the moment I store connection strings externally, but I keep finding hard-coded connection strings all over the web.config xml, various providers etc. It's...

Different connection string for each publish profile in VS2010

Is it possible to change connection string (or just server host) relying on selected web publish profile? Maybe using Web.config transform or someway else? I mean for profile "Test" change connection string "MyConnString" (in published Web.config) to "Data Source='example.com,14333;..." and for profile "Production" - to "Data Source=./S...

Using encrypted web.config file

My aim is to make the web.config not readable by external users, but my application should be able to access it. Is there any way to do this? I have tried the following way, but how to set the application to use string instead of web.config? I want to encrypt my web.config file so that others do not open the file using any editor like ...

Custom web.config sections (ASP.NET)

Hi Apologies in advance for the relatively long post - I've tried to provide as much relevant information as I can (including code listings)! I've been working on implementing a custom section in the web.config file for a little something I'm working for the past few hours, but I can't seem to get it working. The following is what I'd...

Best practice for http redirection for Windows Azure

I have an azure website which is named: http://myapp.cloudapp.net Of-course this URL is kind of ugly so I set up a CNAME that points http://www.myapp.com to the azure url. All is well up until here, but there is a snag. http://myapp.cloudapp.net has leaked out and now is indexed by google and lives on other sites. I would like ...

1 Solution, 2 Proejcts, 2 Web.Configs?

I have an ASP.net solution that includes 2 projects. One of them is basically a class library and the other is a web service that references the class library. I want the library to use a web.config to access global connection strings yet I want the library to be able to function independently of the service. There is a web.config fil...

Configuring NHibernate via Web.config in ASP.NET 4.0

So my unit tests are green, time to integrate this shiny new NHibernate-driven DAL in to my web app! I don't really want to maintain two configuration files so I've migrated hibernate.cfg.xml in to my Web.config file (i.e. I copypasta'd the contents of hibernate.cfg.xml in to my Web.config). Here is the relevant bits from my Web.config: ...

ASP.NET site inside a virtual directory

I am currently putting a new version of my site online. I would like to retain the old site (for purposes of read only access) and have been directed to place it within a subfolder inside the directory where the site use to live. e.g. www.example.com needs to be moved to www.example.com/old and the new site needs to be moved to www.exa...

Changing location of CSS file in master page based on compilation configuration.

Visual Studio 2010 has a new feature that is just way cool. You can now add transformation files that will change the web.config file based on the configuration you are compiling. The upshot of which is that you can change the web.config file for your various environments (eg: dev, staging, production, etc). That's all fine and dandy ...

What do these Visual Studio warnings mean?

Hi folks, My Web.Config Transformations are not getting published - and I think the error has to do with these warning(s) I'm getting. Using Visual Studio 2010, I'm playing around with my Web.Config / Web.Config.Debug files. In my .Debug file, I get the following warning listed numerous times. No element in the source document matche...

asp.net web site - add version number automatically?

Is it possible in an asp.net web site project for it to increment a build version number automatically (and display it to our test team) ...

What is the scope order of .config files

Somehow I screwed with my IIS7 settings, and VS2010 doesn't want to start websites in debugging mode. I spent a few hours convulsively scavenging before I found a solution. It just needed to put into web.config <system.webServer> <validation validateIntegratedModeConfiguration="false" /> </system.webServer> Now, I'd like to put that...

How do you give permissions to ASP.NET AJAX Toolkit in web.config?

Hi, I've been trying to add the ASP.NET toolkit to my web application and I can get the demo site to work but I can't seem to implement any of the controls in my application. After playing around with it for a while, I think I've found the problem. In my web.config, I have: <authorization> <allow roles="Users"/> <deny users="*...

Single Connection String with Multiple Entity Framework Models?

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 p...

Breaking up web.config file system.webServer element

I am trying to break a large web.config file into smaller parts. This has been covered a few times on different stack overflow questions (like this or this) which recommend using the configSource or file attributes. The problem is this does not work for the system.webServer section used to configure IIS 7 in integrated mode. This is par...

Deny access to login page to authenticated user in ASP.NET

Hi all, I'm working on an ASP.NET web application. We've got a login page (index.aspx), as well as a user's "home page", userhome.aspx. What's the most elegant way to deny a user to display index.aspx when they're logged in? At the moment, index.aspx can still be displayed by explicitly typing it into the browser address bar. I tried t...