1. Durandal: TypeScript modules support

    I’m working on a prototype of HTML5 Single Page Application (SPA). I’m happy to use plumbing provided by Durandal. It’s really exciting SPA framework.  Unfortunately it doesn’t support TypeScript modules. According to Rob Eisenberg it won’t be fixed for now (quote below)

    I'd rather not make a change in the core based on the current state of TypeScript. Rather, I'd prefer a plugin that re-configures durandal for this case. But, it will get fixed in TypeScript before v1.0 I confirmed that by checking their roadmap. Also Luke Hoban responded to me via codeplex to say they have every intent to fix it https://github.com/BlueSpire/Durandal/pull/13
    So if we are going to start to use TypeScript with Durandal… we need some workaround. So here we go. First we need to apply below lines into router.js. It will add basic TypeScript modules support. Second step is to enable master\detail scenario by adding below lines into system.js Would be happy to get some feedback on this. …

  2. Typed XML programming

    I want to tell you about very useful project LINQ to XSD

    The LINQ to XSD technology provides .NET developers with support for typed XML programming. LINQ to XSD contributes to the LINQ project (.NET Language Integrated Query); in particular, LINQ to XSD enhances the existing LINQ to XML technology.
    Please consider the following code:
    services services = services.Load(@"c:\services.xml");
    string name = services.service.First(x => x.FullTypeName == "xx").Namespace;
    As you probably understand it reads XML underneath. But you deal with LINQ query and don’t worry about parsing XML. …

  3. TFS 2012 migrated from TFS 2010: Project Creation fails

    As I mentioned previously we migrated to the TFS 2012 + SharePoint 2013. It’s worth to mention that TFS 2012 is just great! It’s so handy to use new dashboards and task planning stuff. We just Love it Smile But today we had to create new project… and it did work for us. TF301777: Team Project Creation Failed New Team Project Wizard encountered the following error and could not continue. Error The Project Creation Wizard encountered an error while creating reports to the SQL Server Reporting Services on http://servername/ReportServer/ReportService2005.asmx. After some Goodling I found Jeremy Jameson blog post on the similar issue. Although our cause was a bit simpler - all the TFS reports were in Reporting Server. So I just had to ran below SQL statements:

    USE master
    GRANT EXECUTE ON master.dbo.xp_sqlagent_notify TO  [NT SERVICE\ReportServer]
    GRANT EXECUTE ON master.dbo.xp_sqlagent_enum_jobs TO  [NT SERVICE\ReportServer]
    GRANT EXECUTE ON master.dbo.xp_sqlagent_is_starting TO  [NT SERVICE\ReportServer]
    USE msdb
    -- Permissions for SQL Agent SP's
    GRANT EXECUTE ON msdb.dbo.sp_help_category TO  [NT SERVICE\ReportServer]
    GRANT EXECUTE ON msdb.dbo.sp_add_category TO  [NT SERVICE\ReportServer]

  4. Schemaless Data Structure

    I planned to get familiar with some of the schemaless databases for a long time. And eventually got time to this a couple of days ago. And it was real surprise for me to see post on this topic on the Martin Fowler’s blog next day since I blogged about my first MongoDB experience. Anyway I highly recommend you to review this great Schemaless Data Structures presentation. …

  5. MongoDB at a glance

    Just finished reading of the MongoDB: The Definitive Guide book. You know it was really exciting. The book is a great introduction to the MongoDB and to the all it’s features. Also there are several nice examples those emphasize the advantages of the document-oriented databases. As for the MongoDB itself, I hope to try it on one of the upcoming projects, cause I suppose document-oriented model will work just great for it. …

  6. Machine.Specifications under TFS 2012

    About year ago we started to use Machine.Specifications (screencast) on one of our projects. It was really nice to have executable specifications and well organized tests. The only issue was is that TFS 2010 Build wasn’t able to run Machine.Specifications. Finally I’ve added some T4 templates to create MSTest wrappers for MSpec code. So we were able to run our tests and see the coverage on the CI server. What’s amazing TFS 2012 support test runner extensions. Hence now we can easily configure our CI server to run Machine.Specifications and show us the code coverage! The step by step guide for NUnit available at http://blog.accentient.com/2012/04/30/RunningNUnitInATFS11BuildOn64BitServer.aspx. For the Machine.Specifications it’s pretty much the same. The only change is that you’ll need to install MSpec Test Adapter instead of NUnit. Also please make sure you selected Visual Studio Test Runner in the build configuration. …

  7. TFS Build - pass build and revision numbers to the MSBuild script.

    If you are using TFS Build as you CI server it’s really simple to pass build and revision number to the MSBuild. Just create a copy of the template you are using at the moment. And then search for the (there are should be 2 occurrences)

    [String.Format("/p:SkipInvalidConfigurations=true {0}", MSBuildArguments)]
    And replace it by the following text:
    [String.Format("/p:SkipInvalidConfigurations=true /p:BuildNumber={1} /p:RevisionNumber={2} {0}", MSBuildArguments, BuildDetail.BuildNumber.Substring(BuildDetail.BuildNumber.LastIndexOf(".") + 1), BuildDetail.SourceGetVersion.Substring(1))]
    MSBuild script should looks similar to:
        <BuildNumber Condition="'$(BuildNumber)' == ''">0</BuildNumber>
        <RevisionNumber Condition="'$(RevisionNumber)' == ''">0</RevisionNumber>

  8. NuGet + Package Restore = Failed Build?

    Recently we faced weird issue with NuGet. Then we build our solution (with Package Restore enabled) build fails due to the NuGet error. We have some packages from the internal NuGet server, hence in NuGet.targets we had this:

    <!-- Package sources used to restore packages. By default will used the registered sources under %APPDATA%\NuGet\NuGet.Config -->
    NuGet output was: One or more errors occurred The command was:
    "c:\ProjectPath\.nuget\nuget.exe" install "c:\ProjectPath\Source\ProjectName\packages.config" -source "https://nuget.org/api/v2/;http://ourinternalnugetserver.com/nuget" -o "c:\ProjectPath\packages"
    What’s interesting if you run NuGet with empty -source you get nice warning:
    WARNING: The schema version of 'Rx-PlatformServices' is incompatible with version 1.8.30524.9000 of NuGet. Please upgrade NuGet to the latest version from http://go.microsoft.com/fwlink/?LinkId=213942.
    *I got above warning after executing below command
    "c:\ProjectPath\.nuget\nuget.exe" install "c:\ProjectPath\Source\ProjectName\packages.config" -source "" -o "c:\ProjectPath\packages"
    Next steps are obvious “nuget update –self” did the trick.
    nuget update –self

  9. Migration to TFS 2012

    Over weekends I worked on migration from TFS 2010 to TFS 2012 + SharePoint 2013. Migration process was pretty straightforward, thanks to TFS and SharePoint teams! During migration I found that some TFS databases are really huge. The answer was that TFS saves all the test binaries, results and code coverage data right inside TFS database (!). For me it was a big surprise. So I had to use Test Attachment Cleaner tool to cleanup all those unnecessary data from TFS:

    "C:\Program Files\Microsoft Team Foundation Server 2010 Power Tools\Test Attachment Cleaner\tcmpt.exe" attachmentcleanup /collection:"http://tfs.example.com:8080/tfs/Collection" /teamproject:"Team Project" /settingsfile:tfscleanup.settings.txt /outputfile:tfscleanup.logs /mode:delete
    cleanup.settings.txt contained the following settings:
        <TestRun >
            <AgeInDays OlderThan="30" />
                <Include value="tr_"/>
                <Include value="tlk"/>
                <Include value="dll"/>
                <Include value="exe"/>
                <Include value="pdb"/>
                <Include value="xml"/>
                <Include value="coverage"/>
                <Include value="config"/>
                <Include value="iTrace"/>
                <Include value="wmv"/>
            <Exclude state="Active" />
            <Exclude state="Resolved" />
    It did the trick. But I had to shrink database cause test attachments were more than 70% of it’s size. Next I used script from MSDN to rebuild all indexes. So if your Build Servers run unit tests, it makes sense to review your TFS databases ;) …

  10. TypeScript - first impression

    Finally got some time to watch Anders Hejlsberg’s Introducing TypeScript. And you know TypeScript is just great. I started my career as a PHP developer and soon I moved to .NET cause I just needed that strong typing :) You know it’s a question of comfort.

    • If you have a compiler that could help you to early discover issues with your code, it's much better then to discover them at run time.
    • Also you can easily refactor your solution.
    So what Anders Hejlsberg and his team did? They brought comfort to the JavaScript developers. If you didn’t have a chance yet, please go and check out TypeScript! …