C# & ASP.NET

@aspnet

Convert string to any type that implements TryParse method

String extension method for converting to other value types
0
In many cases serialized data is returned in a form of string although the actual type of data is different. The problem begings when you want to use data in it's original type becaus direct cast is not allowed in C# as it is in VB.net. This is why you have to use TryParse and safely parse the value to it's original type ... read more

Creating Visual Studio ProjectTemplate VSIX package

How to create VSIX package for ProjectTemplate
 
0
If you often have projects which setup is pretty much the same you might consider creating ProjectTemplate for Visual Studio.It speeds up development for the project setup, adding references, default configuration .config, content files... Before you start make sure that you have installed Microsoft Visual Studio 2013 SDK (http://www.microsoft.com/en-us/download/details.aspx?id=40758) and Nuget Package Explorer (http://npe.codeplex.com/)I also attached a small dummy project just to help understanding what is written in this article.Skipping to hands on code is always more helpful and faster for me to, so if you are bored by reading, download the attached .7zfile and explore it ... read more

Set entry assembly in Unit testing methods

Resolving null entry assembly issue in unit tests
0
Recently I started writing unit tests for a small project I keep in my visualstudio online TFS repository. After few test done I run into an issue. Since this project heavily relies on Reflection and dynamic assembly loading, main class constructor at one point is calling ... read more

Avoiding high processor load in long running loops

Keep processor not overloaded with long runningloops
0
When having a long running loop which you are not sure when it is going to end you will probably have to create a loop in a separate loop and on every iterration you will check whether some condition is true and exit the loop. Let's say you want to execute some piece of code after some specific time, let's say after one minute or everyday at specific time (common scenario in windows services). You can do it really simple with Timer class and just few lines of code as the code below. ... read more

JavaScript

read more

SQL/T-SQL

read more