.NET

@aspnet

Clean up IIS log files from you web server

Avoid low disk space because of IIS logs
0
Microsoft IIS Server is by default logging every request that reaches it. This can be pretty useful for tracking down the issue which my occur over time, but it is also pilling up log files on server's disk which eventually can cause low disk space. You an always clean up these files manually, but wouldn't it be nice if server does that for you? ...read more

Why is JsonRequestBehavior needed?

Understanding JSON data restriction over HTTP GET requests
0
You probably run to this exception when you tried to fetch JSON data over HTTP GET request. Now, first this is easy to bypass by simply adding JsonRequestBehavior.AllowGet option to method which is retutning JSON data for GET request in a controller file. ...read more

Simple Office365 authentication

Use Office365 account login for your application
0
With so many online and cloud based services, adding one more additional account for your application adds additional complexity level for your users since they will have to manage one more account and remember one more password. Microsft ASP.NET comes with pretty nice built in provides for social networks, but for office usage social networks are not so convenient to be used. ...read more

MSMQ recovery with .NET

Using MSMQ with message recovery in .NET
 
0
MSMQ is a bit old stuff and there are bunch of other products out here which perform better in most of the scenarios, but MSMQ is still used in a lot of solutions and Microsoft still did not announce support ending for MSMQ so it will be for sure some more time around.One of the stuff that is missing as out of the box feature in MSMQ is recovery. In scenarios you get the message from the queue and try to process, and process fails, in some of the cases you might want to try to process the message again...read more

Serialize DataTable to JSON with just few lines of code

Generate JSON string from DataTable in C#
0
Although JSON is widely used as a format for sharing the data, there are still existing solutions or modules that still rely on ADO and DataTables. Even today it very common to see some piece of code which deals with DataTable or DataReader for the performance reasons. In the end if any of the ADO objects needs to be exposed as a JSON string you have to write your own serialization code. ...read more

SqlBulkCopy with model classes in C#

Use SqlBulkCopy with model (POCO) classes in C#
 
0
So far (based on my experience) the fastest way to insert big number of records from application to database is to use SqlBulkCopy. The downsize of this is that SqlBulkCopy uses DataTable instace as an input parameter which is not so convenient when dealing with models which are strongly typed and a lot more easy to use than iterating through the DataTable...read more

Debugging Windows Service application with console in C#

An easier way to debug and develop Windows Services
 
0
Developing Windows Service might a a real headache since you do not have any visual part to see the output. Even if you want to rely on Visual Studio debugger you need to install the service, stop it (if already running), deploy, start the service from Windows MMC and finally hook up Visual Studio to the running service process...read more

Non blocking writing to console in C#

Write message to console without blocking current thread
0
The fast and most commonly used method to debug code is for sure using console applications. Since main operations are reading input and writing output, it does not take much to set it up and start debugging your code. One more reason for using console application is to test the performance...read more

IP address filtering from C# code in ASP.NET MVC and Web Api

Restrict or allow specific IP addresses to access your WebApi or MVC
 
 
0
Last year I wrote an article about IP address filtering on MVC and WebApi Restrict Access to an MVC Action or Controller based on IP address. Over time the requirements for IP filtering in several web based application increased, so I had t work on this class to make it more extendible and reusable in different scenarios...read more

.NET managed scheduled task runner

Scheduled managed code execution in .NET
 
0
Sometime ago I wrote an article about Windows Scheduled Task vs Windows Service where I compared and listed benefits and drawbacks of using scheduled tasks in Windows and Windows Services for executing certain operation which repeats in some time span. However idea of executing tasks in a single Windows Service is very useful if you need to execute task in a short time span plus you have a full control including logging and other fine grained customization in case you write the task in your code...read more

MSMQ JSON message formatter

Use JSON to serialize and deserialize message queue messages
0
Storing objects in the message queue (MSMQ) is based on the serialization of the object instance using some of the serializes, basically any class the implements IMessageFormatter. Most commonly used ones are BinaryMessageFormatter and XmlMessageFormatter. I prefer XmlMessageFormatter over BinaryMessageFormatter, mostly because messages are stored in a readable format inside the queue, so in case something goes wrong you can direly check the content of the message using built Computer Management MMC (Microsoft management console) in the. ...read more

JavaScript

read more

SQL/T-SQL

read more

Umbraco CMS

read more

PowerShell

read more