Visual Studio 2013 – Clean Solution

I recently upgraded a project from Visual Studio 2010 / .NET4.0 to Visual Studio 2013 (update 4) / .NET 4.5.
Code that was working for weeks, didn’t work anymore (exceptions in Caliburn.Micro).

I reinstalled all my Nuget packages, verified the public key tokens of the libraries via the Strong Name Tool (SN.exe -T my.dll), did “Clean Solution”, “Rebuild Solution”, rewritten code, etc…

In a desperate action I manually cleaned every bin and obj folder in my Workspace.
After this action the code started to work again.

Then I was wondering: Does the “Clean Solution” in Visual Studio 2013 work different compared to Visual Studio 2010.
An internet stranger gave me a good hint:

“Sorry, but this is simply not true. It does not delete the contents of /obj which are the root of the problem. At least this is the situation with VS 2013 update 3.”

After searching some more, I was happy that I was not the only one who had problems with Visual Studio 2013 and the Clean Solution:

“However, once I’ve converted my projects to Visual Studio 2013 I star receiving error on build or deploy:”

Conclusion: if you upgrade to Visual Studio 2013 and receive strange exceptions, clean the obj directories manually or change your project file to remove the obj directory before each build via the BaseIntermediateOutputPath property/parameter.

By default the BeforeBuild and AfterBuild are not used. You can see this by unloading your project in Visual Studio and then right-mouse click it and select Edit:

<!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
       Other similar extension points exist, see Microsoft.Common.targets.
  <Target Name="BeforeBuild">
  <Target Name="AfterBuild">

Uncomment the BeforeBuild.
Your project file should now contain this:

<!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
       Other similar extension points exist, see Microsoft.Common.targets. -->
  <Target Name="BeforeBuild">
    <RemoveDir Directories="$(BaseIntermediateOutputPath)" />
  <!--<Target Name="AfterBuild">

Information on the BaseIntermediateOutputPath property/parameter:

 “The top-level folder where all configuration-specific intermediate output folders are created. The default value is obj\. The following code is an example:  <BaseIntermediateOutputPath>c:\xyz\obj\</BaseIntermediateOutputPath>”

If you receive the Error after changing the project:

 Unable to remove directory “obj\”. The directory is not empty

Go have a look at this url:
It might also be related to Visual Studio 2013…


Disable the Toggle Completion Mode in Visual Studio

When writing code in Visual Studio, the shortkey Ctrl+Alt+Space toggles the completion mode of IntelliSense in the Text Editor.
The completion mode can be manually changed by going to this menu in VS2012:
EDIT > IntelliSense > Toggle Completion Mode

However the shortkey can be annoying while coding, depending on your keyboard configuration and language.

To disable this shortkey command in Visual Studio 2012 follow these steps:

  • Go to TOOLS
  • Select Options…
  • Go to Environment > Keyboard
  • Below the Show commands containing: type the word completion and hit the TAB-key
  • The filtered listbox should now contain a command called Edit.ToggleCompletionMode
  • Select it and hit the button Remove
  • Click OK to close the Options form

visual studio 2012 keyboard command options

These steps are very similar to Visual Studio 2010.

Get information from Team Foundation Server (TFS) via C# code

This code shows you how you could interact with your team foundation server. In my case a TFS 2010.

Open a new console application in Visual Studio and add these references:

  • Microsoft.TeamFoundation.Client
  • Microsoft.TeamFoundation.VersionControl.Client
TeamFoundationServer tfs = new TeamFoundationServer("http://yourtfsserver:port/something");
List<string> changedFiles = new List<string>();

VersionControlServer VCServer = (VersionControlServer)tfs.GetService<VersionControlServer>();

string path = @"C:\Users\<username>\Documents\Visual Studio 2010\Projects\just the path to your solution";
VersionSpec version = VersionSpec.Latest;
int deletionId = 0;
RecursionType recursion = RecursionType.Full;
string user = @"domain\yourusername";

foreach (Changeset item in VCServer.QueryHistory(path, version, deletionId, recursion, user, null, null, Int32.MaxValue, true, false, true))
  foreach (Change c in item.Changes)
	// c.Item.ServerItem;
catch { }

Happy coding ;)

BugAid for Visual Studio: Enhance your debugging experience

BugAid is an extension for Visual Studio that can help you whenever you debug C# code. Using our unique features you can debug faster than ever before and have more time for writing quality code!

P.S.: If you buy BugAid, I would appreciate it if you leave them a message that you got the news from this blog ;-)

[ link ]

Raise PropertyChanged events without using strings in Prism

While I was testing something with Prism4 + MEF, I found this interesting method overload to raise PropertyChanged events without having to use the string name of the property itself.
Because having a typo in such a string can be very painful. :)

Let’s say you have a ViewModel which derives from the NotificationObject. In the setter I’m using the ‘better’ way of raising that PropertyChanged event:

public class TestViewModel : NotificationObject
private string _Title;

public string Title
get { return _Title; }
if (value != _Title;)
_Title = value;
this.RaisePropertyChanged(() => this.Name);


instead of writing:


If you have already your project full of RaisePropertyChanged methods with strings you can easily replace them in Visual Studio with Regular Expressions:

– Select [Quick Replace]
– In the dropdown menu choose [Replace in Files] instead of [Quick Replace]
– Look in: [Entire Solution]
– check [Use] and select [Regular expressions]
– Find what: RaisePropertyChanged\(\”{[:a]*}\”\)\;
– Replace with: RaisePropertyChanged(() => this.\1);

Have fun ;)

HTML5 support for Visual Studio 2010 Editor

Today, a faction of the Web Platform and Tools team, spearheaded by Mads Kristensen, is pleased to announce the Visual Studio Web Standards Update. This adds better support for HTML5, CSS3 and new JavaScript features to ALL versions of Visual Studio.

More info and the download link here.

[ source ]

Debugger Canvas for Visual Studio

Microsoft and Brown University have collaborated to create Debugger Canvas, a free Power Tool that adds Code Bubbles™ to Visual Studio for a new way to debug.

Do you get lost in the document tabs? Are you tired of the debugger jumping around from file to file? Debugger Canvas pulls together the code you’re exploring onto a single pan-and-zoom display. As you hit breakpoints or step into code, Debugger Canvas shows just the methods that you’re debugging, with call lines and local variables, to help you see the bigger picture.

Release info:

We are currently in the last phase of shipping! The first alpha release will be available in early June 2011. (download link)

Something I will check out for sure! ;)
Update: works only with Visual Studio 2010 Ultimate :(

More info on the Microsoft Research page.

[ source ]

White screen of Darn

Ever had a White screen of Darn (WSOD) in Visual Studio or an error like this: “exception of type was thrown” ?

If the [Clean Solution] and [Rebuild Solution] didn’t work.
Here is how to find the culprit:

  1. Open Visual Studio 2010 and open/load your solution containing the problem
  2. Open a second Visual Studio 2010 instance

In the second VS2010 instance do the following things:

  1. Go to [Tools] > [Attach to Process…]
  2. Select devenv.exe with which contains the solution with the problem from the Available Processes and click OK
  3. Next go to [Debug] > [Exceptions…]
  4. Check [Common Language Runtime Exceptions] in the [Thrown] column

Now go to your first Visual Studio 2010 instance with your project and open the designer file which causes you the PITA (Pain In The Ass).

Your second VS2010 instance should break on the exception, showing you where it goes wrong in your code.

Enjoy ;)

Visual Studio Styles

I’ve been using a new style in Visual Studio recently, because my eyes got a bit too tired of looking constantly at the white background of the editor in Visual Studio 2010.

Today I’ve installed the style also at work and I must say that my eyes like it ^^.

I used “Son of Obsidian” from

Installing this style is simple, if you have problems read the FAQ.

Happy coding ;)

[ source ]