IIS url rewrite role except some urls

You can add the exceptions for which you don’t want to perform the redirect to HTTPS as extra conditions (not equal to that URL), like so: <rule name=”Force HTTPS” stopProcessing=”true”> <match url=”(.*)” /> <conditions logicalGrouping=”MatchAll”> <add input=”{HTTPS}” pattern=”off” ignoreCase=”true” /> <add input=”{REQUEST_URI}” negate=”true” pattern=”^/noredirect/forthis/page\.aspx$” ignoreCase=”true” /> <add input=”{REQUEST_URI}” negate=”true” pattern=”^/noredirect/forthis/page-as-well\.aspx$” ignoreCase=”true” /> <add input=”{REQUEST_URI}” negate=”true” … Read more

Web.config transformation: Unrecognized attribute ‘xmlns:xdt’. Note that attribute names are case-sensitive

I ran into the very same problem. You will find lots of banter out there related to MvcBuildViews and various error conditions. But none seem to mention this particular error. A quick fix that worked for me was to delete the contents of the “obj” directory for the affected web project, then rebuild.

How to encrypt one entry in web.config

You could put the password into a separate section and encrypt this section only. For example: <?xml version=”1.0″ encoding=”utf-8″ ?> <configuration> <configSections> <section name=”secureAppSettings” type=”System.Configuration.NameValueSectionHandler, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089″ /> </configSections> <appSettings> <add key=”Host” value=”www.foo.com” /> <add key=”Token” value=”qwerqwre” /> <add key=”AccountId” value=”123″ /> <add key=”DepartmentId” value=”456″ /> <add key=”SessionEmail” value=”foo@foo.com” /> <add key=”DefaultFolder” value=”789″ … Read more

IIS express: Cannot add duplicate collection entry of type ‘add’ with unique key attribute ‘name’ set to

I think IIS Express probably has 2 <application>-blocks and both will be pointing to the same physicalPath. Go to the IIS Express config file in: My Documents\IISExpress\config\applicationhost.config Search for NewProjectName Change the physicalPath for the root application to something else. Point it to an empty folder. Should look something like this: <site name=”NewProjectName” id=”1″> <application … Read more

IIS Express is automatically disabling anonymous authentication for my project, why?

It was because for some reason, this was in my csproj file: <IISExpressAnonymousAuthentication>disabled</IISExpressAnonymousAuthentication> Setting it to enabled fixes the issue (it can also be done from Visual Studio, select project, F4, set Anonymous Authentication in the properties grid to Enabled).

Where and how to define for my asp.net MVC 3 web application

From my experience, we should turn custom error to On in release mode and turn it off in debug. To automatically do this, we can use web.config transformation like the following example. Web.Debug.config This setting will allow web server to display ASP.NET yellow page that contain useful error information. <customErrors mode=”Off” xdt:Transform=”Replace” /> Web.Release.config In … Read more

Running MiniProfiler with runAllManagedModulesForAllRequests set to false

I had the same issue – the resources being requested use “static” file extensions (such as .js) and therefore IIS wants to handle them using its static file handler. Luckily all of the MiniProfiler resources are requested with the path mini-profiler-resources, so you can add the following to your web.config: <system.webServer> … <handlers> <add name=”MiniProfiler” … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)