I've been having a real struggle trying to set up a demo application in Visual Studio 2015 using Asp.NET Core RC2 and Angular2 RC4. My package.json file (the one npm uses) was only picking up the Angular2 beta releases. I finally found the solution at https://github.com/angular/angular/blob/master/CHANGELOG.md in the section for 2.0.0-rc.0. Open a command window and change directory to the root directory of the solution (i.e. \<solution name>\src\<project name). Then run the command: npm install --save @angular/core @angular/compiler @angular/common @angular/platform-browser @angular/platform-browser-dynamic rxjs@5.0.0-beta.6 zone.js@0.6.12. The dependencies section of my package.json file automagically updated to "dependencies" : { "@angular/common" : "^2.0.0-rc.4" , "@angular/compiler" : "^2.0.0-rc.4" , "@angular/core" : "^2.0.0-rc.4" , "@angular/platform-browser...
Posts
Null Object Pattern
- Get link
- X
- Other Apps

Null Object Pattern Motivation The Null Object pattern can be used to avoid having checks that objects are not null before using them to avoid throwing NullReferenceExceptions, e.g. if (myObject == null) { return; } // do something with myObject… Example For example, say we have a device object with a Connect() method that a client wishes to call. If we're getting the device from a repository we have to do a check for null before calling Connect(). If however the repository returns the null object, no null check is required. The null check is done within the repository so the client code does have to worry about it. Null object code public interface IDevice { string Name { get ; set ; } void Connect (); } public class RealDevice : IDevice { public string Name { get ; ...
- Get link
- X
- Other Apps
Windows Workflow on DotNetRocks Listened to Blake Helms on the DotNetRocks podcast ( www.dotnetrocks.com show 1236) talking about Windows Workflow. You don't hear much about workflow these days so it was interesting to hear that it is being used for large scale complex applications. It was also interesting to hear how he was initially dead against using it but then switched once he 'got it'.
Visual Studion Dotfuscator Community Edition fails to start with error 'The type initializer for “j8” threw exception'.
- Get link
- X
- Other Apps
Answer from StackOveflow that worked for me: If you are running into this error message can you please try adding the “HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows Kits\Installed Roots\KitsRoot” registry key and give it the same value as "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Kits\Installed Roots\KitsRoot"
Catching Exceptions at Top Level in WPF
- Get link
- X
- Other Apps
Add a handler for the DispatcherUnhandledException to the App.xaml file: <Application x:Class="Main.App" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" DispatcherUnhandledException="Application_DispatcherUnhandledException" StartupUri="MainApplicationWindow.xaml"> <Application.Resources> </Application.Resources> </Application> Add the handler for it to the App.xaml.cs file: private void Application_DispatcherUnhandledException(object sender, System.Windows.Threading.DispatcherUnhandledExceptionEventArgs e) { // Do what you want here. The exception can be access...
Debugging Unit Tests
- Get link
- X
- Other Apps
To enable debugging and stepping through unit test code when using NUnit: In the project containing the unit tests add a reference to nunit-console-runner.dll. Add a file to the project called NUnitConsoleRunner, for example. using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Utilities_Tests { public class NUnitConsoleRunner { [STAThread] public static void Main(string[] args) { NUnit.ConsoleRunner.Runner.Main(args); } } } Under the properties for the project: - Application - set the output type to Windows Application. - Debug - set the command line arguments to the name of the executable produced, e.g. Utilities_Tests.exe, and set the working directory to where it lives. Set the project to be the st...
Visual Studio 2010 Intellisense not working correctly
- Get link
- X
- Other Apps