# Monday, October 19, 2009

Registration for the 4th quarter MSDN (.NET) Northeast Roadshow has just opened up!

clip_image001Registration for the 4th quarter MSDN (.NET) Northeast Roadshow has just opened up!  This totally FREE event will be held on Tuesday, December 15th.   Thankfully, we were able to secure more convenient hours this time around.  The event will run from 9:00 am thru 3:30 pm in the Florian Hall of the Central Maine Commerce Center in Augusta. (a.k.a. Public Safety/M.E.M.A)  These events target .NET developers and analysts, or those actively training to become one.  Microsoft Developer Evangelists Chris Bowen and Jim O’Neil will be making the drive up from their regional offices in Massachusetts in order to lead the presentations.

 

AGENDA

•    WCF (Windows Communications Foundation)
•    Silverlight RIA (Rich Internet Applications) and the MVVM design pattern (Model-View-ViewModel)
•    Where to find help when you get stuck.
•    LINQ  (Language INtegrated Query)
•    ASP .NET Webforms and AJAX

Please register in advance by using the following link:
http://msevents.microsoft.com/CUI/EventDetail.aspx?EventID=1032429336&Culture=en-US

#    Comments [0] |
# Sunday, October 18, 2009

Windows 7 resources for developers

Jim O’Neil has a great post with a list of links to resources that are useful for developers targeting Windows 7.

Go here: http://blogs.msdn.com/jimoneil/archive/2009/10/17/code-camp-12-7-on-7-resources.aspx

#    Comments [0] |
# Friday, October 16, 2009

Dutch Windows 7 Community Launch

The Dutch Windows 7 Community Launch will be held on Monday night during the Software Development Conference 2009.

SDC 2009 attendees will receive a link per email to register.
If you are not an attendee at SDN Conference 2009 then register through the Microsoft website.

#    Comments [0] |
# Sunday, October 11, 2009

Unblocking assemblies in Windows 7

I just ran into a little problem when attempting to run a Visual Studio unit test on my Windows 7 machine. I downloaded log4net.dll and wanted to use it in a project, but when running the unit test I ran into the following error:

Failed to queue test run 'Mark@L-ONE 2009-10-11 14:08:38': Test Run deployment issue: The location of the file or directory 'c:\users\mark\documents\visual studio 2008\projects\sources\developone.myproject.unittests\bin\debug\log4net.dll' is not trusted.

Turns out that a downloaded file is blocked. You can unblock the file by right clicking the file and choosing “Unblock”.

image

Make sure you remove all copies of the assembly (if you have copy local = true) and then recompile.

#    Comments [0] |
# Tuesday, September 08, 2009

Windows Vista Home editions do not have remote desktop

I just spend 15 minutes trying to get a remote desktop connection to a brand new Windows Vista box. Couldn’t get it to work. Turns out it runs a Home Edition of Vista.

Important note: Remote desktop is only included in the Professional, Business, or Ultimate versions of Windows. Home editions do not have remote desktop.

More information on enabling Remote Desktop Connections: http://www.howtogeek.com/howto/windows-vista/turn-on-remote-desktop-in-windows-vista/

#    Comments [0] |

MSDN Northeast Road Show will hit Augusta, ME on 24th of September 2009

Chris and Jim are coming to Maine and this time their bringing their TechNet friend Dan Stolts.
Augusta will be home to the MSDN Northeast Road Show and the TechNet Unleashed tour on the same day!

More info on the event can be found at: http://blogs.msdn.com/cbowen/archive/2009/07/20/announcing-the-fall-2009-northeast-msdn-roadshow.aspx

Note: You need to register separately for the MSDN and TechNet event!

Update [09-10-2009]: Corrected Jim’s name and Dan is the man that is doing the ITPro sessions :-)

#    Comments [1] |
# Wednesday, August 26, 2009

Tools that make a developers life easier

Last night at the BAND (www.bangordevelopers.com) meeting we all did 10 minute presentations on the tool(s) we love as developers.

On my list were: Total Commander, LinqPad, Microsoft Office (codegen with Excel rules :-)), VMWare & VirtualPC, Live Mesh. Also on the list should have been Reflector.

Total Commander

Great tool for FTP-ing files and comparing a local folder hierarchy to the hierarchy on the ftp-server. Also much more reliable in FTP-ing large amounts of files than Windows Explorer.
image

See: www.ghisler.com

LinqPad

A must have for people using LINQ to SQL and Entity Framwork. Helps a lot with figuring out what the exact SQL statement is that get generated from your LINQ statement.
image
See: www.linqpad.net

VMWare Converter, VMWare Workstation and VirtualPC

These tools are invaluable in creating clean testing environments and separating multiple development environments on a single machine. VMWare converter allows you to grab a physical harddrive and convert it into a virtual machine. Very useful for Windows 7 migration scenarios!
See: www.vmware.com, www.microsoft.com/virtualpc

Live Mesh

Is only in beta, but already an invaluable tool for remote desktop connections across firewalls and synchronizing files across (virtual) machines.
See: www.mesh.com

Reflector

.NET Reflector is a tool any serious .NET developer cannot do without. View sources of any .NET library you use in order to track internal workings. Love it!
See: http://www.red-gate.com/products/reflector/

#    Comments [0] |
# Thursday, August 20, 2009

LINQ to Outlook

VSTO offers a number of classes to access Outlook information, but these classes do not implement IEnumerable<T> and are therefore not useable in a LINQ expression.

I wanted to be able to search for appointments using LINQ and write code that looks like this:

var appointments = new Appointments();

var selectedAppointments = from appointment in appointments
                           where appointment.Start <= end    // end is parameter
                           && appointment.End >= start       // start is parameter
                           && appointment.Categories.Contains("Billable")
                           orderby appointment.Start
                           select appointment;

To do this I converted the Items collection in an Outlook Folder to an IEnumerable<Outlook._AppointmentItem>.
The code for the Appointments class looks like this:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Outlook = Microsoft.Office.Interop.Outlook;

namespace Develop_One.OBiOne
{
    /// <summary>
    /// Class to wrap a collection of Outlook.Items as an IEnumerable of Outlook._AppointmentItem.
    /// Doing this allows you to write LINQ queries against the Appointments.
    /// </summary>
    internal class Appointments : IEnumerable<Outlook._AppointmentItem>
    {
        private Outlook.Items _items;

        /// <summary>
        /// Default constructor will use the items in the default Calendar folder to initialize items collection.
        /// </summary>
        internal Appointments()
        {
            var app = new Outlook.ApplicationClass();
            var cal = app.Session.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderCalendar);
            _items = cal.Items;
        }


        #region IEnumerable<_AppointmentItem> Members

        public IEnumerator<Outlook._AppointmentItem> GetEnumerator()
        {
            // use the private AppointmentsEnumerator.
            return new AppointmentsEnumerator(this._items);
        }

        #endregion

        #region IEnumerable Members

        System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
        {
            return this.GetEnumerator();
        }

        #endregion

        private class AppointmentsEnumerator : IEnumerator<Outlook._AppointmentItem>
        {
            private System.Collections.IEnumerator _items;

            internal AppointmentsEnumerator(Outlook.Items items)
            {
                _items = items.GetEnumerator();
            }


            #region IEnumerator<_AppointmentItem> Members

            public Outlook._AppointmentItem Current
            {
                get
                {
                    return (Outlook._AppointmentItem)_items.Current;
                }
            }

            #endregion

            #region IDisposable Members

            public void Dispose()
            {
                return;
            }

            #endregion

            #region IEnumerator Members

            object System.Collections.IEnumerator.Current
            {
                get
                {
                    return (Outlook._AppointmentItem)_items.Current;
                }
            }

            public bool MoveNext()
            {
                bool result = _items.MoveNext();
                while (_items.Current is Outlook._AppointmentItem == false && result == true)
                {
                    result = _items.MoveNext();
                }
                return result;
            }

            public void Reset()
            {
                _items.Reset();
            }

            #endregion
        }


    }
    

}
#    Comments [1] |

Paste from Visual Studio

I just came across a nice add-on for Windows Live Writer which allows you to paste colorized source from Visual Studio.

Download it here: http://gallery.live.com/liveItemDetail.aspx?li=d8835a5e-28da-4242-82eb-e1a006b083b9&bt=9&pl=8

#    Comments [0] |

Some useful DateTime extensions

I’m doing some work where a user can select data based on choice like “This week” and “Last month”. I wrote a bunch of extension methods that are pretty generic and may be useful for others.

Here is is:

public static class DateTimeExtensions
{
    /// <summary>
    /// Return the date that is the start of the week relative to the specified date.
    /// </summary>
    /// <param name="date"></param>
    /// <returns></returns>
    public static DateTime GetStartOfWeek(this DateTime date)
    {
        DayOfWeek day = date.DayOfWeek;
        int days = day – CultureInfo.CurrentCulture.DateTimeFormat.FirstDayOfWeek;
        DateTime start = date.AddDays(-days);
        return start.Date;
    }

    /// <summary>
    /// Return the date that is the start of the week relative to the specified date.
    /// </summary>
    /// <param name="date"></param>
    /// <returns></returns>
    public static DateTime GetStartOfLastWeek(this DateTime date)
    {
        return date.GetStartOfWeek().AddDays(-7);
    }

    /// <summary>
    /// Return the date that is the end of the week relative to the specified date.
    /// </summary>
    /// <param name="date"></param>
    /// <returns></returns>
    public static DateTime GetEndOfWeek(this DateTime date)
    {
        return date.GetStartOfWeek().AddDays(6);
    }

    /// <summary>
    /// Return the date that is the end of the week relative to the specified date.
    /// </summary>
    /// <param name="date"></param>
    /// <returns></returns>
    public static DateTime GetEndOfLastWeek(this DateTime date)
    {
        return date.GetEndOfWeek().AddDays(-7);
    }

    /// <summary>
    /// Return the date that is the start of the month relative to the specified date.
    /// </summary>
    /// <param name="date"></param>
    /// <returns></returns>
    public static DateTime GetStartOfMonth(this DateTime date)
    {
        return new DateTime(date.Year, date.Month, 1);
    }

    /// <summary>
    /// Return the date that is the start of previous month relative to the specified date.
    /// </summary>
    /// <param name="date"></param>
    /// <returns></returns>
    public static DateTime GetStartOfLastMonth(this DateTime date)
    {
        return date.GetStartOfMonth().AddMonths(-1);
    }

    /// <summary>
    /// Return the date that is the end of the month relative to the specified date.
    /// </summary>
    /// <param name="date"></param>
    /// <returns></returns>
    public static DateTime GetEndOfMonth(this DateTime date)
    {
        return new DateTime(date.Year, date.Month, date.GetDaysInMonth(), 23, 59, 59, 999);
    }

    /// <summary>
    /// Return the date that is the start of previous month relative to the specified date.
    /// </summary>
    /// <param name="date"></param>
    /// <returns></returns>
    public static DateTime GetEndOfLastMonth(this DateTime date)
    {
        return date.GetStartOfLastMonth().GetEndOfMonth();
    }

    /// <summary>
    /// Returns the number of days in the month of the specified date.
    /// </summary>
    /// <param name="date"></param>
    /// <returns></returns>
    public static int GetDaysInMonth(this DateTime date)
    {
        return DateTime.DaysInMonth(date.Year, date.Month);
    }

    /// <summary>
    /// Return the first day of the year relative to the specified date.
    /// </summary>
    /// <param name="date"></param>
    /// <returns></returns>
    public static DateTime GetStartOfYear(this DateTime date)
    {
        return new DateTime(date.Year, 1, 1);
    }

    /// <summary>
    /// Return the first day of the last year relative to the specified date.
    /// </summary>
    /// <param name="date"></param>
    /// <returns></returns>
    public static DateTime GetStartOfLastYear(this DateTime date)
    {
        return new DateTime(date.Year - 1, 1, 1);
    }

    /// <summary>
    /// Return the last day of the year relative to the specified date.
    /// </summary>
    /// <param name="date"></param>
    /// <returns></returns>
    public static DateTime GetEndOfYear(this DateTime date)
    {
        return new DateTime(date.Year, 12, 31, 23, 59, 59, 999);
    }

    /// <summary>
    /// Return the last day of the last year relative to the specified date.
    /// </summary>
    /// <param name="date"></param>
    /// <returns></returns>
    public static DateTime GetEndOfLastYear(this DateTime date)
    {
        return new DateTime(date.Year - 1, 12, 31, 23, 59, 59, 999);
    }

}
#    Comments [7] |
# Tuesday, August 11, 2009

Zune HD now on pre-order

Zune HD The Zune-HD has gone on pre-order at Amazon.

Pre-Order Zune HD
#    Comments [0] |
# Thursday, August 06, 2009

Finished upgrade to Windows 7

windows 7 rev vI just finished upgrading my laptop (main machine) to Windows 7. I decided to go with an in place upgrade (after making a backup :-) ). I was a little worried that the Live Mesh beta might cause some problem, but… no problem. The system has been upgraded, Office 2007 is running, my Adobe AIR apps are running and Live Mesh is fully operational!

Congrats to Microsoft for an excellent upgrade experience!

image

#    Comments [0] |
# Wednesday, August 05, 2009

Microsoft Security Essentials

Just answered a question from a buddy about Windows Live One Care. The Live One Care product is being discontinued and will be replaced by Microsoft Security Essentials.
Microsoft Security Essentials is in beta right now. From what I understand Microsoft Security Essentials will be a free solution.
More info here: http://www.microsoft.com/security_essentials/.

From KezNews: “…the final product will be available only before end of 2009...”

#    Comments [0] |

Sponsored Tweets: The end of Twitter?

Just found out that there is now a company offering sponsored tweets (http://sponsoredtweets.com/). Will this be the end of Twitter, or will my virus scanner move these messages to my ‘spam tweets container’? Where do I get to opt-out? The site pretends to do ethical spamming (http://sponsoredtweets.com/ethics/) but offers no simple opt-out feature.

#    Comments [0] |
# Tuesday, August 04, 2009

Upgrading to Mac OS X Snow Leopard

Looks like Mac OS X Snow Leopard has gone into pre-order mode (look here). Too bad they don’t support my iMac anymore. The latest version(s) of iTunes won’t install on Mac OS X 10.3 and Snow Leopard won’t run on non-intel processors so my PowerPC G4 in my iMac is feeling more and more obsolete by the day.

Upgrade info:

Please note, that only Apple OS X Leopard users are eligible for the Snow Leopard upgrade. Tiger & earlier OS users will need to purchase either versions of the upgraded Mac Box Set. Also, Snow Leopard will only run on intel-based Mac computers.

More here.

#    Comments [0] |
# Thursday, July 30, 2009

ASP.NET 4.0 beta 1 playground

Just got an email from my favorite Internet provider (aren’t they the real cloud?) and they’re offering a ASP.NET 4.0 beta playground.

Quote:

“DiscountASP.NET, in partnership with Microsoft offers a FREE ASP.NET 4 hosting sandbox for MsDeploy RC1 and Visual Studio 2010 beta 1 users to experience 1-Click publishing.
The sandbox hosting program is a limited program offered as an open beta on a first come first serve basis. The account comes with 50 MB of disk space and 50 MB of SQL Server 2008 database space. The FREE ASP.NET hosting sandbox supports .NET Framework 4.0 beta 1, which is not a go-live version. This platform is only intended for testing and should not be used for production purposes.”

Go to www.discountasp.net for more info.

discountasp

#    Comments [0] |
# Wednesday, July 29, 2009

Windows 7 performs better than WindowsXP

Just came across an interesting article from GCN (Government Computer News), quote:

“It’s a victory that performance didn’t drop from XP, which we still consider one of the best operating systems out there. The fact that Windows 7 increased performance slightly across the board is pretty amazing…”

Read the full item here: http://gcn.com/Articles/2009/07/27/GCN-Lab-Windows-7-Performance-Tests.aspx

#    Comments [1] |

New Ergo keyboard

I received a door prize at last night’s BAND meeting: a Microsoft Natural Ergo Keyboard 4000.
I’ve got still got to get used to a little bit, but it feels good already :-)

#    Comments [1] |

Gartner predicts growth in software spending for 2010

After all the misery around the financial crisis is nice to see that Gartner is expecting a turnaround in 2010. Read more here: http://www.gartner.com/it/page.jsp?id=1096812.

#    Comments [0] |