Skip to main content

Posts

Angular 1.x to Angular 2 Quick Reference

A little bit short on time today. So I only want to share this great link that compares the syntax between Angular 1.x and Angular 2: http://blogs.msmvps.com/deborahk/angular-1-x-to-angular-2-quick-reference/ As I’m struggling a little bit with the new syntax, this is a great help when you couldn’t remember the exact code required. You can always fallback to the official documentation , but this Quick Reference is a lot shorter and easier to use…

TFS 2013 XAML Builds: BuildDetail variable no longer available

After upgrading a customer from TFS 2012 to TFS 2013, we couldn’t access the BuildDetail property anymore inside our XAML build process template. Instead we got the following error message: Error 102 Compiler error(s) encountered processing expression "BuildDetail.DropLocation". 'Microsoft.TeamFoundation.Build.Client.BuildDetail' is not accessible in this context because it is 'Friend'. This is a breaking change when upgrading from TFS 2012 to TFS 2013. Luckily it is not hard to solve: Open your XAML build process template Add a Variable on the Variables tab Choose IBuildDetail as type Name it BuildDetail Drag a GetBuildDetail activity inside your workflow Set the Result property to the BuildDetail variable Now you can access the same information as before…

Entity Framework Async: The source IQueryable doesn't implement IDbAsyncEnumerable<>

While investigating an Entity Framework issue, I stumbled over the following exception The source IQueryable doesn't implement IDbAsyncEnumerable<VLM.PlattelandsLoket.Domain.Views.Codes.CodeValueView>. Only sources that implement IDbAsyncEnumerable can be used for Entity Framework asynchronous operations. For more details see http://go.microsoft.com/fwlink/?LinkId=287068 . What’s causing this error? Entity Framework 6 introduced async support through a set of extension methods. These extension methods are defined on IQueryable and IEnumerable but actually expect an IDbAsyncEnumerable implementation behind the scenes  to work. When you try to use one of these extension methods on a LINQ query that isn’t an Entity Framework query, you end up with the error message above. I have to say I’m not a big fan of this approach, it sounds like a ‘leaky abstraction’ to me. What do you think? Code smell or not?

.NET 4.5 Bug: Either ErrorMessageString or ErrorMessageResourceName must be set, but not both

When running an ASP.NET application on top of .NET 4.5, we encountered the following error: Either ErrorMessageString or ErrorMessageResourceName must be set, but not both The strange this was that we only noticed the issue on our test environment. On our local machine the application worked fine. Luckily an explanation was found on the following blog: http://gunnarpeipman.com/2015/02/either-errormessagestring-or-errormessageresourcename-must-be-set-but-not-both/ It seems that this is a bug in .NET 4.5, as we had .NET 4.6 running on our local machine, it explained that we couldn’t reproduce the issue on our local dev machines. As a workaround, you can follow the suggestion as mentioned in the post. Add an ‘ErrorMessage=null’ property to your Data Annotation:

MultipleActiveResultSets–what is it and should I use it?

On a project I had to review, I saw that one of the developers had enabled MultipleActiveResultSets(MARS) in the connection string.  "Data Source=MSSQL1;Initial Catalog=AdventureWorks;Integrated Security=SSPI; MultipleActiveResultSets=True "; When I asked if he was aware that it was enabled and asked the reasoning behind it, the answer was a blank stare: He just copied the connectionstring over from another project but had no idea why this setting was there. MARS was introduced in SQL Server 2005 and enable the possibility to maintain multiple active statements in one connection. This enables the following possibilities: Applications can have multiple default result sets open and can interleave reading from them. Applications can execute other statements (for example, INSERT, UPDATE, DELETE, and stored procedure calls) while default result sets are open. I see it most of the time in combination with Entity Framework when someone...

NuGet: Powershell script to set ‘Build Action’ property of files to ‘Content’

One of the nice things you can do with NuGet is to trigger a Powershell script (Install.ps1) when the NuGet package is installed or removed. From the documentation : A package can include PowerShell scripts that automatically run when the package is installed or removed. NuGet automatically runs scripts based on their file names using the following conventions: Init.ps1 runs the first time a package is installed in a solution. If the same package is installed into additional projects in the solution, the script is not run during those installations. The script also runs every time the solution is opened (Package Manager Console window has to be open at the same for the script to run). For example, if you install a package, close Visual Studio, and then start Visual Studio and open the solution with Package Manager Console window, the Init.ps1 script runs again. Install.ps1 runs when a package is installed in a project. ...

TFS 2015 - Release Manager Workflow Migrator

The ALM rangers never sleep. Now they have created a Release Manager Workflow Migrator: Looking to export a Release Management agent based deployment pipeline so that it can be reused in the Release Management service in Visual Studio Team Services (VSTS)? We have released a migration tool and associated guidance as an open source project, allowing you to use “as is” or contribute to the project. If a Pull Request shows up at the door for the source or documentation, it will definitely be considered. So if you are using Release Manager today and want to switch to the new Release Management service in VSTS, this will be a great help! More information: https://github.com/ALM-Rangers/Migrate-assets-from-RM-server-to-VSTS