Archives

Archives / 2011 / December
  • ASP.NET MVC: Helper method to display date ranges

    I have events web site where I want to show events start and end time to visitors. I wrote simple extension method called DisplayTimeRange() to display event time range on user-friendly manner. My goal is to show times as 01.01.2012 10:00 – 14:00 and 01.01.2012 15:00 – 01.03.2012 18:00. It’s practically displaying time ranges is shortest possible way. In this posting I will show you how to do it using extension method.

    Read more...

  • Windows Azure error: An unsupported response was received. The response header 'MSDeploy.Response' was '' but 'v1' was expected.

    You may get the following error when deploying your web application from Visual Studio to Windows Azure using WebDeploy:

    Remote agent could not be contacted. Make sure the remote agent service is installed and started on the target computer.

    An unsupported response was received. The response header 'MSDeploy.Response' was '' but 'v1' was expected.
    The request was aborted: The request was canceled.
    COM object that has been separated from its underlying RCW cannot be used.

    If you monitor your HTTPS traffic you can find out that response to WebDeploy request was error 401 (not authenticated). Although I don’t know what is the exact source of this error there is simple solution: close Visual Studio and then run it again. Now you should be able to deploy your application.

    Read more...

  • The selected database contains foreign keys that create a cycle

    You may get the following error when creating data scripts with MSSQL 2008: The selected database contains foreign keys that create a cycle. Publishing data only is not supported for databases with cyclical foreign key relationships. This problem is caused by self-referencing tables and it is given even if you don’t export data from one of such tables. Here is simple and very dirty solution.

    Read more...

  • Deploying independent web applications to Windows Azure using single web role

    I found very good blog post by Andy Cross’ Blog where he describes how to deploy multiple web sites in a single Windows Azure web role. I like the idea but there are some things that should be understood and done differently if you plan to use same web role for totally different web applications that you want to run on your Windows Azure instance. In this posting I will show you how to deploy independent web applications to Windows Azure instance using single web role.

    Read more...

  • ASP.NET security update shipping tomorrow

    Out-of-band security update will be published for ASP.NET tomorrow. Security update will solve publicly known DoS issue that exists in all versions of ASP.NET. Update will be delivered through Windows Update and Windows Server Update. More details:

    Read more...

  • My next year TOP5 wishlist for Windows media, WP7 and XBox teams in Microsoft

    After building up my home network where XBox streams media from Windows Home Server using Windows Media Center I was very happy with my solution. Over weeks and months of active consuming of my media I found a lot of things that need to be improved or fixed. I am still happy but sometimes I’m looking already for alternatives. Here is my TOP5 wishlist for Microsoft people who build consumer media products.

    Read more...

  • Connecting Windows Home Server to web through two routers

    I wanted to get my Windows Home Server configured correctly for web so I have valid certificate by Microsoft and I can use subdomain service they are offering. As my home network is not default that is expected by Windows Home Server (no direct access to router that is connected to web) I had to trick my WHS a little bit. In this posting I will show you how to get Windows Home Server work with Microsoft address (http://something.homeserver.com) if it is not connected directly to router that has access to web.

    Read more...

  • MSSQL & NHibernate – mapping week numbers to properties

    In one of my applications I have to use week numbers as properties of business classes that are persisted to database using NHibernate. Week numbers are used in UI and users can filter and sort data by week numbers. In this posting I will show you how to make SQL Server deal with week numbers and how to use them in your domain model.

    Read more...