Thursday, April 29, 2010

Netbook and Windows Anytime Upgrade

I mentioned in a previous post that I struggled with how to access my creative juices while on vacation while not toting around an extra ten pounds of gear. I settled on a HP Mini 210, it's a little underpowered, but it weighs in around 3 pounds which isn't too bad as extra weight. It has 1 GB memory (nothing like my Dell Quad Core with 8GB!) and it is limited in disk space. I left my 500GB hard drive at home as I didn't want to cart that around as well. I've got quite a bit of things on this laptop even so.

  • Visual Studio 2010
  • SQL Server 2008 Express
  • Mercurial plus all of the devs tools I could think of - WinMerge, e, nant... I did miss TestDriven.NET, so I'll have to figure how that works into writing code.

After rushing to install everything I thought I'd need I decided at 2.30 am (with a 4.45 wake up forthcoming!) to try an upgrade from Starter edition to Home Professional. Don't be fooled, it says that the upgrade will take 10 minutes or so, unless there are Windows Updates! Doh! I think I finished out with a workable system again more than an hour later! I recommend if you're going to do an Anytime Upgrade on your system to do it with time to spare. I was wondering if I had bricked my new system right before the trip! It all worked out and went smoothly, but not without some minutes of stress in the wee hours.

HG Walkabout

Just prior to taking a three week vacation to Europe I splurged and purchased a Netbook (HP Mini 210-1032CL). I don't recommend doing this at the very last minute, but sometimes...

I have a copy of O'Reilly's Mercurial book and I spent time looking around for a digital copy of the book. I didn't find it on the 'net. I finally located it while I was sitting at the gate in SFO in the TortoiseHG docs directory *sweet*!

I discovered that it was quite easy to use the great 'hg help' command. I found out that first I need to remove the chaff from CVS (CVS artifacts.) I also was scratching my head for a bit trying to figure out how to ignore files that I did not want added to the repository.

Directly from the hg help init:

hg init [-e CMD] [--remotecmd CMD] [DEST]

create a new repository in the given directory

    Initialize a new repository in the given directory. If the given directory
    does not exist, it will be created.

    If no directory is given, the current directory is used.

    It is possible to specify an "ssh://" URL as the destination. See 'hg help
    urls' for more information.

Now that I had a repository built I knew that I needed to tell Mercurial what files were in it. I forged ahead and did a 'hg add' only to discover that I'd inadvertently added all of the CVS directories as well as the files that typically end up in our .cvsignore files. So that lead me to discover both 'hg remove' and 'hg forget', all three commands are described below:

hg add [OPTION]... [FILE]...

add the specified files on the next commit

    Schedule files to be version controlled and added to the repository.

    The files will be added to the repository at the next commit. To undo an
    add before that, see hg forget.

    If no names are given, add all files to the repository.

hg remove [OPTION]... FILE...

aliases: rm

remove the specified files on the next commit

    Schedule the indicated files for removal from the repository.

    This only removes files from the current branch, not from the entire
    project history. -A/--after can be used to remove only files that have
    already been deleted, -f/--force can be used to force deletion, and -Af
    can be used to remove files from the next revision without deleting them
    from the working directory.

hg forget [OPTION]... FILE...

forget the specified files on the next commit

    Mark the specified files so they will no longer be tracked after the next
    commit.

    This only removes files from the current branch, not from the entire
    project history, and it does not delete them from the working directory.

To undo a forget before the next commit, see hg add.
I think I've figured out that there are multiple ways to save yourself with Mercurial. I thought I had to do a 'hg remove' and a 'hg forget', but I believe that could have been avoided by supplying an option to the remove command - 'hg remove --force' which says remove (and delete) file even if added or modified.

Sidebar: I'm flying at 573mph ground speed at 35000 feet somewhere over Lake Michigan right now. Yes I know in the first paragraph I said that I was sitting in the San Francisco airport at the gate, but I was interrupted when I had to get on the plane, a lunch/dinner and subsequent knap. My clock says its just after midnight in London, I'm not ready to give into the sleep and change time zones just yet :)

Using e-TextEditor now and you get the Mercurial icons in the Project viewer. Nice!

snap-20100429-0029

Friday, April 23, 2010

IIS7 CryptographicException - The system cannot find the file specified.

I found a strange error while getting my application to run on Server 2008 R2. Below is a description of a similar problem and the resolution. Its duplicated here in case the other blog disappears in the future.

From blog - MaeSitus-Sitecore

CryptographicException file not found in Sitecore
Today I came across issue with CryptographicException file not found in Sitecore. See below

Server Error in '/' Application.

THE SYSTEM CANNOT FIND THE FILE SPECIFIED.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Security.Cryptography.CryptographicException: The system cannot find the file specified.


Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.


Stack Trace:

[CryptographicException: The system cannot find the file specified. ] System.Security.Cryptography.Utils.CreateProvHandle(CspParameters parameters, Boolean randomKeyContainer) +7715070 System.Security.Cryptography.DSACryptoServiceProvider.ImportParameters(DSAParameters parameters) +258 System.Security.Cryptography.DSA.FromXmlString(String xmlString) +501 Sitecore.Nexus.Licensing.NexusLicenseApi. (String xml, Guid instance) +138 Sitecore.Nexus.Licensing.NexusLicenseApi.GetSnapShot(Guid instance) +764 Sitecore.SecurityModel.License.LicenseManager.GetSnapshotData(Guid instance) +59 Sitecore.SecurityModel.License.LicenseManager.UpdateSnapshot() +103 Sitecore.SecurityModel.License.LicenseManager.Initialize() +8 Sitecore.Nexus.Web.HttpModule.Application_Start() +76 Sitecore.Nexus.Web.HttpModule.Init(HttpApplication app) +435 System.Web.HttpApplication.InitModulesCommon() +65 System.Web.HttpApplication.InitModules() +43 System.Web.HttpApplication.InitInternal(HttpContext context, HttpApplicationState state, MethodInfo[] handlers) +729 System.Web.HttpApplicationFactory.GetNormalApplicationInstance(HttpContext context) +298 System.Web.HttpApplicationFactory.GetApplicationInstance(HttpContext context) +107 System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +289


Version Information: Microsoft .NET Framework Version:2.0.50727.4927; ASP.NET Version:2.0.50727.4927

After consulting with my colleague, the solution is to do with IIS settings.

To resolve this,

1. go to IIS Manager
2. go to the application pool instance
3. click advanced settings
4. Under Process model, set Load User Profile to true