I’m working for a simple project and wanted to deploy it to the webserver in my church. I installed TeamCity and set it up to pull the source code from github and build it. The challenge was, unexpectedly, publish. Initially, I used MS Web Deploy. For some reason I couldn’t figure out, it didn’t work. Also, […]
I don’t usually use python. My daily language is C#, so it was a nice, refreshing time to code in python. A couple of weeks ago, I wrote a small plug in with Emily, that checks the disk free space in servers where rabbit-mq is installed. We had failing tests because rabbit-mq mal-functioned due to […]
It is not a good practice to catch System.Exception, as the catch block will be executed with unexpected exceptions and it will hide the real error. But sometimes, you want to catch multiple exceptions in order to avoid unnecessary repetitive code. For example, In this case, you can catch System.Exception but limit the impact with […]
When you try to debug your website locally, often Visual Studio shows more than one w3p.exe processes, if you run multiple application pools. Attaching to all of them is a bit annoying. In this case, this command comes handy.
In unit-tests, you mock out external dependencies. With Mock framework, you can verify that a correct value is passed into the dependency. Today, I had a case that a dictionary object is passed into the dictionary. I wasn’t sure how to verify that the value is correct, as what I wanted was just to check […]
Actually, this includes ReSharper shortcuts as well. Visual Studio & ReSharper CTRL + SHFT + N: Go to a file (ReSharper IDEA shortcut) CTRL + -: Go to a previous cursor location. This is very handy when you copy and paste the same text to multiple rows, as it remember your cursor location before you […]
Injecting dependencies into ASP.NET MVC controllers is straightforward with Ninject. Just install Ninject and Ninject.MVC3 via nuget. It will create a file “NinjectWebCommon.cs” under App_Start folder. And you add your service bindings in RegisterServices method like this. Yet, out of the box, it doesn’t support web api controller dependency resolution. You need to create your […]