18 May 2010

Upgrading project from VS2008 to VS2010

 

I have a project that I manage that as a development team we decided to upgrade to VS2010 from VS2008.  There was not a huge reason for this, but was interested in trying out the beefed up testing, coverage and profiling tools in VS2010.

The upgrade of the project went pretty well, except for some problems with PostSharp, that were able to be resolved by upgrading to a CTP version of PostSharp 2.0.  The reasoning for that and the list of struggles will have to be another post.

After getting things to compile and run on my local machine, decided that it was time to commit back to SVN for the rest of the team to use.  I expected to have problems with the build server, which runs CCNet, but was not sure what it would be.  So for the sake of documenting this for myself, here is what I had to do.

Steps:

  • Install the 4.0 Framework.
  • Build error for missing import: C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets
    • I copied the entire C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0 folder to my build server
  • Could not load assembly Microsoft.ReportViewer.WebForms
    • Copied C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bootstrapper\Packages\ReportViewer\ReportViewer.exe to build server and ran the installer.
  • error MSB3454: Tracker.exe is required to correctly incrementally generate resources in some circumstances, such as when building on a 64-bit OS using 32-bit MSBuild. This build requires Tracker.exe, but it could not be found.
  • error MSB3086: Task could not find "LC.exe" using the SdkToolsPath
    • OK – I seem to be stuck here until there is an SDK to support 4.0.

At this point, I changed my build process to call MSBuild from the 3.5 framework instead (which we were still targeting despite using VS2010).  This created some warnings about referencing a 4.0 ToolsVersion (Project file contains ToolsVersion=4.0, which is not supported by this version of MSBuild. Treating the project as if it had ToolsVersion=3.5.), but got me past the issues I was having until the Windows 7.1 SDK is released.

29 June 2009

SVN Merge Tool

I am currently working on a project that has had a fair amount of development that was done on a branch to support current production while there was some major refactoring and new functionality being added to head.  While working independently on each branch, all was fine.  So, now i got stuck with doing the merge.  Not exactly fun.

I have been using TortoiseSVN’s built in merge tool and was doing pretty good with it.  I am not sure that I think it (I assume SVN itself) does as good of a job merging as I thought CVS did, seems like I have a lot of conflicts that I wonder why were conflicts.  That said, I got to the point where the merge comparisons were not lining up right and making things very difficult to decide what should be done. 

So, I began to search for replacements.  I tried 2, but have stuck with one that I think works fairly well.  It is the Perforce Visual Merge Tool.  While Perforce is not free, the merge tool is.  It was easy to setup with TortoiseSVN too:

image

For ease, here is the command:

C:\Apps\Perforce\P4Merge.exe %base %theirs %mine %merged

(change to match your install path as needed).

Here is a screenshot of one of my merges:

image

04 June 2009

Sharing keyboard and mouse between 2 computers

My “regular” machine is a laptop and has been for many years now.  The flexibility of being able to move around for meetings, design sessions and being able to close up and continue at home make that the best choice for me.  That said, both at the office and at home, I have another desktop computer that I can use to do different things.  At home, it has my video processing stuff installed on it, at the office it is just there for email, browsing, etc when my laptop is busy or off.  While it took me awhile to move to dual monitors for my primary machine, I adopted being able to use both computers at once a long time ago.  Until today, I only knew of one piece of software that did this, Synergy.  I have really like it for the most part.  It seemed to have hiccups every once in awhile, but restarting it was not too bad and not an every day occurrence.  After Vista came out, the biggest problem was that I could not have it startup automatically like I had on XP.  The project is open source and has not been updated in awhile, so I wasn’t anticipating that this would be something addressed soon and while trying to complete my setup of my laptop with Windows 7, thought I would google to see if there was something else.  There is, Input Director.  I installed this on both machines here at the office in a matter of a couple of minutes and got things up and running.  Seems to work good so far.  And it looks like it will address my issue with being able to start at startup.

Here is a screenshot of setting up the master and the hosts.  You can drag the computers around to show where they are in relation to your master.  This is much nicer than Synergy.

image

10 November 2008

List<T>.Find()

I am going to try to document issues that I found not intuitive or easy to figure out (which may or may not be sleep deprivation induced), so here is my latest with an issue with List<T>.Find().

With the List<T>.Find method, you are supposed to supply a predicate, which is really just a delegate with a boolean function determining if a match happened.  So, when would this fail?

List<IItem> items = new List<IItem>();



if (items.Find(item => item.ItemId == smi.ItemId) == null) {


    items.Add(csFacade.GetItemByItemId(smi.ItemId));


}




Answer:  when items contains a null.  My assumption going into this was that I would always get a valid result from the method adding to the items list, but it may return null. 



So, to solve this, I would either need to evaluate the return from GetItemByItemId and only add if not null, or change my predicate to check for null before comparing the ItemIds.

08 November 2008

Setting up IIS7 for a Maverick.Net project

(Thanks to Paul Fox for these instructions)

  • Open IIS Manager by pressing "Windows Key" + R
  • Type "inetmgr" and press Enter
  • Expand the System and "Web Sites" nodes and click on "Default Web Site"
  • Click on "Handler Mappings"
  • Click "Add Script Map"
  • Add the following settings
    • Request Path: *.m
    • Executable: C:\Windows\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll
    • Name: Maverick.Net
    • Click on "Request Restrictions" and uncheck "Invoke handler only if request is mapped to:"
    • Click OK.

image