Install Tailspin Travel on Windows 7 SP1
If you try and install the tailspin travel demo on Windows 7 with service pack 1 , it will fail saying the operating system is not supported
Thankfully this is easy to fix, in the C:\TailspinTravel\assets folder is a Dependencies.dep file. Open that in notepad (or text editor of your choice) and navigate to the <os> element. Note the buildNumber attribute is set to: 7000;7100;7600
All you need to so is change it to: 7000;7100;7600;7601
As in the screenshot above, now save and rerun setup and you will succeed!
How to attach to process before the application even starts?
There is many ways to do debugging in Visual Studio, normally you just hit F5, compile & run the code with debugging. However sometimes you need to debug an executable you have already built or debug on another machine. I have mentioned this previously you can use the Attach to Process option to do debug MSCRM assemblies that exist on other machines and/or run by a executable you do not control.
This works great but recently I had an issue where the application would start and (silently) die within seconds, but only in test (never in dev). It just happened so quickly that I could not attach the debugger in time. So how can you debug that scenario?
Thankfully this is very easy, just go to your Visual Studio project settings and switch the Start Action to Start External Program, set the path to the executable and then hit F5!
What this will do is start the executable, attach the debugger and work with your code all for you – so no more racing against the attach to debugger options
Missing Code Analysis
If you have Visual Studio 2010 you may be annoyed when you want to run code analysis and it is just not there! You can configure it, but cannot run it?!
The reason is that code analysis is only available for the selected project, and you likely have the solution selected in the Solution Explorer (or Solution Navigator). You will need to select the project first and it will appear.
No solution wide code analysis yet either. However I believe these annoyances will be corrected in the next version of Visual Studio
NDepend: Power tip to analyse quickly
Update: This has changed with version 3.8, read the awesome news at A follow up to my NDepend pro tip...
I am a a big NDepend fan – I can’t imagine doing analysis or taking over new projects without it! If you have not heard of NDepend, then have a look at: NDepend - The field report
I feel stupid for not finding this power tip before, but recently I had about 20 projects to analyse - a situation that appeared to be painful because it meant creating NDepend projects for each one.
Thankfully I stumbled on the terribly named Select .NET assemblies to Analyze option in the file menu. This is option is actually a way to create a quick temp NDepend project!
Once you have clicked that, you should click the choose VS solutions option and you get another great dialog showing you a list of your Visual Studio recent solutions! This is great because I would load the code in VS, build it (to make sure it can build) and run code metrics against it and having this quick selector linked to VS meant that I do not need to browse for the solution NDepend again!
Possible bug in it though, where it doesn’t show web projects; WinForms, console apps etc… all fine just not web projects?!
Select the one you want, hit OK twice and analysis starts!
Happy analysis!
Pepper: A Visual Studio Settings Synchronisation & Backup Extension
Pepper is a new free extension for Microsoft Visual Studio 2010 that I have created to solve a major pain which I am calling SLM (setting lifecycle management
). The problem is that settings inside Visual Studio are vast & complex, and configuring your IDE is a labour of love, taking years of fine grain tweaks. I can personally trace back my settings to sometime in 2005 and have been tweaking and fiddling ever since.
Once when I moved jobs I forgot to copy my settings and VS felt broken until an ex-co worker was able to get a backup of my old laptop restored and sent me the file. Wouldn’t it be great to have a backup system in the cloud? Say on Azure?
This brings about another interesting scenario, what if I have multiple machines? Can I backup on one machine and restore on another? Giving me a synchronisation system for Visual Studio settings?
Pepper does exactly that, it automates the export/import of settings and allows you to place them in a SQL Azure database!
This is the first release, and while it has had some beta testing it is not perfect so please, if you give it a go and it fails, let us know in the discussions.
Pepper is available in the Visual Studio Gallery, which means you can install it and keep it up to date inside Visual Studio too!
Visual Studio Recent Settings
When you use the import settings option inside Visual Studio, you may notice a long list of settings Recent Files with no way to clear them out.
If you do want to clear this out, you can do this by going to the following registry key:
HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\10.0\Profile\BrowseFiles
Note this is completely unsupported, but I have done it without any issues.
SharePoint Holiday Loader
March 19, 2012: This tool has had a major make over since the original release!
I’m sure, as a SharePoint power user, you’ve had the fun of your boss walking up to you and asking why the public holidays aren’t in your SharePoint calendar? (guess what happened to me last week)
You would think this would be easy, in fact Outlook supports adding holidays to calendars easily. So why isn’t SharePoint easy like that too?
I’ve had this asked a few times and never had a good answer to do it, so I decided that a simple tool needed to be built to solve this once and for all – Let me introduce SharePoint Holiday Loader (SHL).
SHL takes a standard holiday file (.hol) and allows you to publish that to a SharePoint list!
This tool is very easy to use (just need the file, the server and the calendar name) and it is free and open source. You can get the download the tool, source code, leave comments (or complaints) at: https://bitbucket.org/rmaclean/sharepoint-holiday-loader/
Source Code Management for the Individual SharePoint Developer
With SharePoint 2010 and Visual Studio 2010 the ability to be a productive developer was key and there is tight out-of-the-box integration and this means that it is easy for SharePoint developers to put code into source control easily. Hilton Giesnow covers this brilliantly in a video he has: http://bit.ly/g71Gnb
Imagine a number of dedicated SharePoint developers, they may have an enterprise ALM solution like TFS and on their own machines have SharePoint 2010 Developer and VS2010 installed and life is good – but what about the individual, or ad-hoc, developer?
The problem for him is that installing SharePoint 2010 is a resource hog and you may not want it running all the time (what Hilton nicely calls the 9 to 12 development) and what about if you switching between projects, how do you switch SharePoint? The solution I found, is to have a virtual machine (VM) for SharePoint with the dev tools installed and do all work on the VM. This is great because the overhead is only there when you need it and you can easily switch between different virtual environments. The downside: source code management.
Sure you can hook up the VM to the network and manage code using the source control as you are used too, but this isn’t always easy or possible, so what else you can do? I had this problem recently where the source control is on one domain and my development was another domain. I choose to use the Mercurial Distributed Version Control System (DVCS) and I thought I would share this experience with you.
DVCS differs from “traditional” source control like TFS or SubVersion which has a client/server model where each developer is a client talking to a central server, however in DVCS every developer is their own server and does pushes/pulls (think like a sync) between other developers.
What this enables is a very lightweight set of tools installed along side SharePoint and the developer tools on the VM. At the end of each day I could run Mercurial on my machine and pull the source control down to my own machine. This meant the VM had the code and my “real” machine had the code. Then this code could easily be checked into the corporate source control system creating another backup and ensuring compliance with source management policies!
This has been a very exciting project and this configuration really made the management of the source code very smooth.
Dev4Devs - it's coming!
Update: Event moved to the 5th March 2011 - details: http://blogs.msdn.com/b/southafrica/archive/2011/01/18/devs4devs-returns.aspx
Dev4Dev’s, my favourite event, is coming up soon! It is a free event which happens at Microsoft offices on a Saturday morning where you get to see a variety of topics! The key points that make this awesome:
- Each presentation is 20min long – so all meat in the topics with no fluff!
- Even though it is as Microsoft, it is not Microsoft – some fantastic non-Microsoft technologies has been shown before.
- It’s developers presenting to developers – so no marketing nonsense.
- You can apply to present in one of the slots – so if you want to present at bigger events (TechEd, DevDays etc…) this is a great way to get on the radar of those who make those decisions!
All the details at: Devs4Devs Returns
For me this is the first one I will miss as I will be in Seattle for MVP Summit
What's in Microsoft.VisualBasic for C# Developers: Part 7 - File System
[This blog is part of a larger series, to find more parts in the series please see the Series Index]
The FileSystem class is what originally brought me to explorer this assembly because there is some very interesting options in the class which aren’t available elsewhere. To add to confusion there is two FileSystem’s in the Microsoft.VisualBasic namespace :
- Microsoft.VisualBasic.FileSystem
- Microsoft.VisualBasic.FileIO.FileSystem
The one I am interested in, and this post covers, is the second one which has some fantastic options: unfortunately there is way more functions in there than a single blog post can cover (27 methods not counting overloads), so I am going to focus on just two of them which bring new features, i.e. not just wrapping some other .NET API.
DeleteDirectory
The first I want to look at is the DeleteDirectory method which allows you to easily delete a directory. What makes this fantastic is that it can empty the directory of files first (i.e. it handles non-empty directories). Second it supports deleting to the recycle bin and finally it supports a nice pretty UI for the deletion action, including confirm dialog and progress bar dialog.
string testFolder = FileSystem.CombinePath(Environment.GetFolderPath(Environment.SpecialFolder.Desktop),"Demo"); FileSystem.CreateDirectory(testFolder); FileSystem.DeleteDirectory(testFolder, UIOption.AllDialogs, RecycleOption.SendToRecycleBin, UICancelOption.ThrowException);
In the code above uses a few options from FileSystem.
- CombinePath – this is provides a error checked and normalised concatted path using System.IO.Path.CombinePath.
- CreateDirectory – this does some error checking and wraps System.IO.Directory.CreateDirectory.
- DeleteDirectory – This is what we are talking about with the display of UI and send to recycle bin enabled.
There is similar methods to DeleteDirectory, such as MoveDirectory & CopyDirectory and similar items for files: CopyFile, MoveFile etc…
FindInFiles
This is a very useful function which allows you to search files on your machine for specific content (i.e. search in the file, not just the filename). This is not wrapping any functionality behind the scenes (for a change):
string myDocs =Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments); var result = FileSystem.FindInFiles(myDocs, "MVP", true, SearchOption.SearchTopLevelOnly); MessageBox.Show(result.Aggregate((c, n) => { return c + Environment.NewLine + n; }));
The above code shows me searching the My Documents folder for any file with the letters MVP (in any case – controlled by the third parameter). It can be filtered using standard wildcards and and search sub-directories too