Tag Archives: ASP.NET

MSBuild task to compile LESS files

When you are using LESS to create dynamic style sheets the performance of your website will increase when you compile those files to CSS before uploading the webapplication to a server. In this post I’ll describe how to create a build task for MSBuild that will compile all LESS files in a directory. I use this task in my deployment environment for web applications. It is part of a series of tasks that build the application, copies all the files to a deployment directory and does some post processing (compressing JavaScript, images, etc.). Of course it is possible to compile LESS files dynamically using a HttpHandler as well, for more information visit dotless.org.

Continue reading MSBuild task to compile LESS files

Fix .NET 4 SocketPermission for MySQL driver in Medium Trust

Most .NET 4 shared hosting providers offering their customers a medium trust environment. This is not a problem for most web applications unless the applications uses MySQL in combination with the .NET MySQL driver (MySQL.Data.dll). The MySQL driver connects to the MySQL database using a socket. However, sockets are not allowed in medium trust. The application will throw a SecurityException with the following message:

Continue reading Fix .NET 4 SocketPermission for MySQL driver in Medium Trust

Using log4net to show NHibernate SQL in Visual Studio

I’m currently developing a web application in ASP.NET MVC and NHibernate. Since the application was very slow at some points I wanted to know which SQL queries NHibernate was executing. Since the log4net library was already included in the application I searched for a solution to output the SQL queries to the console in Visual Studio 2010 using log4net. I found the solution on this wiki and this blog post.

Continue reading Using log4net to show NHibernate SQL in Visual Studio