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

Saturday, January 29, 2011

Report Control Formatting in Firefox

When displayed on a Safari or Firefox, the ASP.NET ReportControl renders incorectly - like a small box in the corner. This can be fixed by setting the style in the control:


Style="display: table; margin: 0px; overflow: auto;" runat="server"

This suggestion can be found in the forum post:
http://social.msdn.microsoft.com/Forums/en-US/vsreportcontrols/thread/d5157c21-f271-4f17-bac4-3e27dbc9e0cf

Thursday, January 20, 2011

JQuery Intellisense not working in VS2008

For intellisense to work in Visual Studio for JQuery, the following is required:

1. Visual Studio SP1 applied
2. jquery-1.2.6-vsdoc.js file downloaded from jquery and put in scripts folder for the project
3. The master page must reference jquery files like this:



Note: The ~ in front is important.

Links:
http://weblogs.asp.net/scottgu/archive/2008/11/21/jquery-intellisense-in-vs-2008.aspx
http://blog.bvsoftware.com/post/2008/11/06/JQuery-Intellisense-in-Visual-Studio-2008-Tip-if-its-not-working-in-MVC.aspx

Tuesday, January 18, 2011

Add/Delete certificates for local system account

For services applications that are running under the local system account, certificates can be added for that account by running a snap-in for the MMC. When a certificate is added to the registery for the local system, it can then be reached by the service for authentication.

-- Select StartRun and enter mmc.
-- In the console, select FileAdd/Remove Snap-in
-- Select Add, then select Certificates and click Add
-- To manage certificates, select the option Computer Account and click Next
-- Select Local computer and click Finish
-- Click Close, then Okay
-- Expand the tree for Certificates/Trusted root/Certificates
-- The trusted root certificates (accessed as "ROOT" in code) can be managed from here

More information can be found at:
http://technet.microsoft.com/en-us/library/bb680501.aspx

VS 2008 MVC "Project Type not supported"

When trying to open some sample MVC .csproj or vb.proj project files, the error returned "The project file "\\home\username\Data\Visual Studio 2008...Commerce.MVC.Web.csproj" cannot be opened. The project type is not supported by this installation."


This can be fixed by editing the project file for the element . The guid should be changed to "{F85E285D-A4E0-4152-9332-AB1D724D3325};{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}"


More information can be found here:



Tuesday, December 23, 2008

ReportViewer.Reset()

If compiling and running a project or website with a report view component generates the error Method not found: 'Void Microsoft.Reporting.WebForms.ReportViewer.Reset()' or 'Reset' is not a member of 'Microsoft.Reporting.WebForms.ReportViewer':

Download a fresh ReportViewer:

http://www.microsoft.com/downloads/details.aspx?FamilyId=E7D661BA-DC95-4EB3-8916-3E31340DDC2C&displaylang=en