Third Shelf

Unit test deployment issue when file is untrusted

Posted in visual studio by Sydney du Plooy on April 5, 2010

Recently, I decided to use NHibernate in a project so that I could achieve database affinity. That provided me with another benefit and that was the ability to create a database in-memory for testing purposes. Sounded great, but while trying to run the unit tests using MsTest and SQLite, I received the following error: “Test Run deployment issue: The location of the file or directory ‘C:\projects\myproject\SQLite\sqlite3.dll’ is not trusted.“.

That problem was easily solved by simply unblocking the file. Below are the steps on how to unblock the file:

  1. Right-click the blocked file (sqlite3.dll), and then click Properties.
  2. This will open the properties dialog:
  3. In the General tab, click Unblock.
  4. Click on OK.

That’s it, the file is now trusted and the runtime should be able to load the file successfully.

XML Intellisense for NHibernate

Posted in .net, visual studio by Sydney du Plooy on May 16, 2009

nhibernate-intellisenseUsing NHibernate requires the writing of some tedious XML-based configuration mapping files. Remembering all the tags and attributes can sometimes be overwhelming. Thankfully the contributors decided to include intellisense hints, which are in nhibernate-configuration.xsd and nhibernate-mapping.xsd.

In order to have the hints available in Visual Studio 2008 copy the files into C:\Program Files\Microsoft Visual Studio 9.0\XML\Schemas and restart Visual Studio.