Tips, Tricks, and Fixes for when your computer doesn't do what it's told.

Tuesday, June 14, 2011

Web.config encryption

To encrypt the connection string section of a web config file:

1. Open a command prompt and cd to:
c:\Windows\Microsoft.NET\Framework\v2.0.*
2. Type the command:
aspnet_regiis -pe "connectionStrings" -app "/sitename" -prov DataProtectionConfigurationProvider

Note: The provider parameter is needed otherwise the app cannot read the encrypted section and will return the error "The RSA key container could not be opened"

More information: http://msdn.microsoft.com/en-us/library/ms998280.aspx

Monday, June 13, 2011

Visual Studio crashes creating entity data model

One way around this is:

1) Open the "Visual Studio 2008 Command Prompt" (with administrator privileges if Vista)
2) devenv /resetskippkgs
3) Close Visual Studio
4) devenv /setup
5) Run Visual Studio

Found in: http://forums.asp.net/p/1414299/3114264.aspx