Posts

Multiple Classes with RoleEntryPoint As The Base Class

When starting the Development Fabric for Windows Azure in Visual Studio 2010 are you getting this error:   Windows Azure Tools: Start role failed for one or more roles Windows Azure Tools: Role instances did not start within the time allowed. Please try again. If you continue to encounter this behavior please try shutting down the Development Fabric.   In your output window? Or, maybe you are seeing these errors in your Windows Event Viewer under the application log:   The worker process for application pool '{B97C113B-B318-4AFC-84DA-XXXXXXXXX}' encountered an error 'The configuration section 'system.webServer/globalModules' cannot be read because it is missing a section declaration ' trying to read global module configuration data from file '\\?\D:\T\s0\deployment(2)\res\deployment(2).XXXXXX. WebRole.0\temp\temp\applicationHost.config', line number '0'. Worker process startup aborted. Or:   Failed to initiali...

Some new SQL Server Whitepapers

I receive permission to repost some white papers that I did this year for Microsoft, they are available below Best Maintenance Tools for PTC Windchill on Microsoft SQL Server 2008 [ PDF ] The majority of the content is generic and applies to almost any database running on SQL Server Best Drive Configuration Practices for PTC Windchill on Microsoft SQL Server [ PDF ] The majority of the content is generic and applies to almost any database running on SQL Server Optimizing Fill Factor for SQL Server [ PDF ] Going with the default fill factor and using GUIDs in indices is a dumb idea – it will often lead to 95% fragmentation of indices… Using Management Data Warehouse for Performance Monitoring [ PDF ] This is an ultra sweet component of SQL Server 2008. Imagine having performance monitor running always with all measures being recorded into a SQL Server database (including any custom ones you create). It exists and is part of...

Missing Windows Azure Assemblies

Image
With all installations the developer needs to make sure that all the components to run the software are on the machine where their software is too run; Windows Azure is no exception. This article explains how to check all your assemblies before you upload using a Windows Azure Web Role that I wrote called Azure GAC Viewer .  The web role lists all the assemblies in the Windows Azure GAC and evaluates uploaded Visual Studio Project file; removing the guessing out of the process.   When I ship software as a running Windows application (think install on your desktop box), I check to make sure all the dependencies are either already on the box or installed as part of our installation; these include the right runtime libraries, third party DLLS, etc. Usually this is done with installation software like InstallShield.   With Windows Azure we need to make sure that all the assemblies that are not already installed on Windows Azure are included in the package that is uplo...

Windows Phone 7

Image
Looking forward to Windows Phone Unleashed Developer Events {6230289B-5BEE-409e-932A-2F01FA407A92}

Calculating Optimal Fill Factors for SQL Server Indexes

Tonight I gave a presentation on SQL Server to the Bellingham .Net group that was well received.  The PDF of the PPT is at: http://lassesen.com/msdn/ProSQLServerTalk.pdf for those that missed the talk.   There are two formulas that I gave which I thought deserved a recap. The first formula gives the optimal value for a batch setting where you are wishing the maximum throughput to occur for inserts. At the start, the throughput will be very high and then drop off as fragmentation takes over.   CREATE FUNCTION [ dbo ] . [ Fn_OptimalThroughputFillFactorForRandom ] ( @KeyBytes float , @GrowthPercentage float ) RETURNS int AS BEGIN If @KeyBytes < 2 SET @KeyBytes = 2 If @GrowthPercentage > 0.06 SET @GrowthPercentage = 0.06 If @GrowthPercentage < 0.001 SET @GrowthPercentage = 0.001 DECLARE @FillFactor float DECLARE @Rate float DECLARE @Offset float Set @Rate ...

User Saved Safe URL without security risks

Often there is a need to have a url like: https://myhost/AccountStatement.aspx?accountId=0392342&Date=20111109 Unfortunately this opens a security risk. The https protects the page contents but not the URL. The URL is sent as open text. The above URL tempts hackers that may also be users of the system to try enumerating various accountId in the hope that someone has forgotten to check the access permission against the user for each account (A naive assumption is that you don’t know the account number unless you are the owner…).   One solution is to put put the data in a post back and thus take it off the URL line – unfortunately it is not friendly because it prevents a user from saving the URL for quick reference.  You can have both friendly and secure by encrypting the arguments.   If you use a Membership Provider you have a key that you can use for encrypting, using the user name or host name results in a second key so you can now well encrypt the URL Pa...

A Generic GetProperty

Bill from VisibleReality.com shipped me a generic version of the code that I forgot initially on my prior post. Here it is.   You need to include: Code Snippet using System; using System.ComponentModel; The code Code Snippet /// <summary>      /// Gets the property value.      /// </summary>      /// <typeparam name="T"> The type of the property value to get. </typeparam>      /// <param name="dataItem"> The data item. </param>      /// <param name="field"> The field. </param>      /// <param name="defaultValue"> The default value. </param>      /// <returns> The property value. </returns>      public static T GetProperty<T>( this object dataItem, string field, T defaultValue = default (T))     {        if (dataItem == null )       {          throw new ArgumentNullException ( "dataItem" );       } ...