Development (101)


Losing project references on build with Visual Studio 2010

While building a Vb.net Windows service the references to a couple of other projects within the same solution seemed lost. While the references where still there, in the project properties the framework target was set to .Net Framwork 4 Client Profile. Change it to .Net Framwork 4 and you’ll get your references back !




String.Format in Jquery

  Code Snippet postcodeSelections += $.validator.format('<select size="4" name="{0}" id="{1}" tabindex="10" class="dropdownPostcodes">', postcodeSelectionsIdentifier, postcodeSelectionsIdentifier);




Scaffhold views/controllers within n-tier solutions. EF Code first flavour.

I’ve been struggling for a while this morning, trying to use one of the most popular MVC tools features: the ability to generate a controller with the CRUD (Create, Read, Update, Delete) actions over a model. The generator will create the different views as well. Or better.. it should =) Everything works smoothly when you […]




Easy Asynch emails in MVC 3

Here’s a workaround if you’re facing issues implementing the Smtp.SendAsync() method. It doesn’t require any change in your actions or controllers (like changing them to be AsycController). If  you got one, you can implement the below in your service layer. The original code is in Vb.Net, like the project I am working on…sorry . Btw […]




Sql server enable tracing

SELECT * FROM ::fn_trace_gettable (‘c:giorgiotracesql.trc’, default) where CPU > 10000




Get database Id in Sql Server

Just run this: SELECT db_id(‘databasename’)




Moq a Vb.net Sub

While mocking a VB method I was getting the following error : ‘Public Function Setup(expression As System.Linq.Expressions.Expression(Of System.Action(Of EmailSender.IMailManager))) As Moq.Language.Flow.ISetup(Of EmailSender.IMailManager)’: Expression does not produce a value Here’s the moq setup : mailManager.Setup(Function(x) x.SendEmail(It.IsAny(Of MailManagerSettings))).Verifiable() Because the SendEmail method is a Sub instead of a Function. Let’s replace the Setup target Function with a […]




Troubleshooting IIS 7.5 on Window 7

I’ve just installed IIS 7.5 on a machine with Windows 7. Of course the website I deployed didn’t work on the first attempt, here’s a few steps to fix the missing (or wrong) settings on the webserver. Before starting ensure the url you enter on the browser points to the deployed website. Main things to […]




JQuery filtering an array of objects using a condition

The equivalent of a Linq.Where() in JQuery: var elem = $.grep(postcodeResults, function (n) { return n.Udprn == selectedOption; }); Next step will be using linqjs




LuceneWrap write.lock FIX

After getting a feedback on an article I’ve posted time ago on Codeproject I’ve updated the source code in order to fix an appended lock created after a search.  I’m posting here the project because the article is approved on Codeproject and to get it changed I’ll need to contact the staff, wait, post the […]