Using NuGet with Ninject MVC3

May 7, 2011 | In Development | No Comments

If you have not used NuGet yet I strongly recommend you have a look.  It’s a Visual Studio extension that simply takes the hassle out of having to download, install, reference etc. libraries and third party tools.  It will automatically update everything for you in your project.  Have a look here http://www.nuget.org.

Now I’m a fan of Ninject (http://ninject.org) an inversion of control dependency injection container, and a fan of ASP.NET MVC (http://asp.net), so in order to use Ninject and MVC 3 you can use NuGet to setup it for you.

To do this run the following package install command in the Package Installer:

install-package ninject.mvc3

What’s really neat about NuGet is that it will also install any dependencies, so in this case will also install Ninject itself.

Error finding ‘log4net’ library

February 15, 2011 | In Development | No Comments

When using log4net in a .NET 4 project, when you compile the project you can get an error saying that it cannot find ‘log4net’ or ILog.

The solution seems to be that the framework for the project is set to ‘.NET Framework 4 Client Profile’, while what it needs is ‘.NET Framework 4′.  You can change this in the project properties page.

It seems to be something to do with System.Web, but haven’t narrowed it down more than that.

Multiple startup projects in Visual Studio 2010

February 8, 2011 | In Development | No Comments

If you want to debug more than one of the projects in your solution in Visual Studio 2010, you can set multiple startup projects.  Obviously this does not apply to projects such as class libraries, which will be loaded as per your single startup project, but if you have if you have multiple independent projects, say a WPF project and a web service project, then this can be useful.

The option is  available from the right-click menu on the Solution:

setstartup.png

Which opens a dialogue allowing you to pick which projects to start:

multipleprojects.PNG

Next Page »

Login | XFN| WP
Powered by WordPress with cmb-web Theme design by Christian Bridge-Harrington.
Blog feed. Valid XHTML and CSS. ^Top^