Encrypting Connection String in web.config

To save having to visit external links, in C:\Windows\Microsoft.NET\Framework\v4.0.30319 (for .NET 4 / 4.5) aspnet_regiis.exe -pe “connectionStrings” -app “/YourWebSiteName” -prov “DataProtectionConfigurationProvider” To decrypt connectionStrings section using this tool, you can specify following command in aspnet_iisreg.exe tool. aspnet_regiis.exe -pd “connectionStrings” -app “/YouWebSiteName”

Why are some Web.config transforms tokenised into SetParameters.xml and others are not?

This actually has nothing to do with config transforms. I just posted a very detailed blog at http://sedodream.com/2010/11/11/ASPNETWebApplicationPublishPackageTokenizingParameters.aspx. But some info here for you. In the Web Publishing Pipeline (WPP) we handle connection strings as special artifacts. We will automatically create parameters for you for all connection strings. This is because in many cases when … Read more

Differentiating web.config between dev, staging and production environments

My approach has been to have multiple config files. I put all environment agnostic stuff (i.e. doesn’t matter if dev, staging, or production) in the web.config file. Anything that is specific to the environment (i.e. database connection info, logging, debug settings, etc.) I put into a local.config file specific to the environment. You can then … Read more

Conflicting versions of ASP.NET Web Pages detected: specified version is “1.0.0.0”, but the version in bin is “2.0.0.0” in ASP.MET MVC 3

I had this issue after upgrading to VS 2013 Express Preview. Then I noticed there was a line in web.config that was: <add key=”webpages:Version” value=”1.0.0.0″ /> Changed it to the version of system.web.webpages.dll in my bin folder: <add key=”webpages:Version” value=”3.0.0.0″ /> …and the problem went away. (in your case I guess it’s 2.0.0.0.)

Is it possible to use custom error pages with MVC site but not Web API?

Well, after a nearly a year of letting this question marinade, I gave it another shot. Here’s the web.config magic that got me what I wanted: <!– inside of <configuration> to allow error responses from requests to /api through –> <location path=”api”> <system.webServer> <validation validateIntegratedModeConfiguration=”false” /> <httpErrors errorMode=”DetailedLocalOnly” existingResponse=”PassThrough” > <clear/> </httpErrors> </system.webServer> </location> <!– … Read more

exePath must be specified when not running inside a stand alone exe

You need to use a different configuration manager in a web context. The following code block shows an example of how to deal with this: System.Configuration.Configuration configuration = null; if (System.Web.HttpContext.Current != null) { configuration = System.Web.Configuration.WebConfigurationManager.OpenWebConfiguration(“~”); } else { configuration = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None); }

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