Setting up your Mac for .NET development

Last night I spent a few hours getting my Windows virtualization setup so I could use Visual Studio from the Mac. It ended up being way cooler and easier than I thought. All it requires is two simple things, Parallels and mklink. Parallels I was hesitant about paying $79 for virtualization software when other software like VirtualBox is completely free. My advice, try the free trial of Parallels and you will understand why it is worth the price. »

A MSBuild convention proposal - Targets per assembly

MSBuild.aspx) is a very powerful build tool. Unfortunately, in my experience, I have seen it utilized very little. Instead, developers rely entirely on Visual Studio for the build, which is a mistake. I think there are a couple reasons for this: Modifying the build feels like you are mucking in the internals of Visual Studio There is no convention based approaches for how to handle custom bulid targets Now, you could go the way of NAnt, and have complete independence from Visual Studio. »

Analyzing Visual Studio Build Performance

Every now and again, your build time gets so long you have to investigate what the cause is. Since Visual Studio uses MSBuild, it is possible to get very detailed build information. The first step is getting into diagnostic mode. This will print out way too much information, but it is the only mode that prints out execution summaries for each project. To get into diagnostics mode, simply go to Tools -> Options -> Projects and Solutions -> Build and Run. »

Find Orphaned Solution Files

Each day, I am becoming more and more OCD. Tonight I wrote a script that will analyze a Visual Studio csproj file and compare it to the files in the directory. The main goal being an easy way to find orphaned files that might still be in version control. It probably only works on very vanilla projects, but I figured I would share anyways. # find-orphanedFiles.ps1 # # Compare files »

Find All References to a DLL, in Powershell

Visual Studio confuses me, and it is slow. I wanted to find all the assemblies/projects that contained references to System.Web.Mvc. Instead of loading up Visual Studio, I just did this. gci -recurse -filter "*.csproj" | ?{ select-string "System.Web.Mvc" -path $_ } Faster than loading Visual Studio, I promise. »

Powershell script to Register Visual Studio Schemas

I always have to Google how to add an XML schema to Visual Studio because I forget the directory (even though it is super easy). Never again will I forget. function register-vsschemas() { begin { $schema_folders = gci $env:ProgramFiles -Filter "Microsoft Visual Studio*" | gci -Filter "Xml" | gci -Filter "Schemas" } process { if(!$_ -or !(Test-Path $_)) { Write-Error "File '$_' not found" break; } if((gi $_).Extension -ine ".xsd") { Write-Warning "File $_ does not end in an .xsd extension" } foreach($folder in $schema_folders){ #It is very interesting I had to use .FullName... »

Visual Studio Tip: Show All Files

I discovered a Visual Studio feature that I probably should have noticed years ago. It is pretty awesome, and right in front of your face. Show All Files Just click the icon in the Solution Window highlighted in the above screenshot. Bam, all files in the directories get shown, even if they aren’t part of the project. Pretty awesome, especially because of the Include in Project functionality. Much quicker to add items to a project than Add Existing Items. »