I'm unable to run MSTest Tests with code coverage enabled while using NHibernate. I get the following error message:
Unit Test Adapter threw exception: Type is not resolved for member 'NHibernate.Cfg.HibernateConfigException,NHibernate, Version=2.1.2.4000, Culture=neutral, PublicKeyToken=aa95f207798dfdb4'..
Edit : Same thing happens when I turn on deployment (open local.testsettings under deployment enable deployment)
Maybe old thread, but I just found the solution and wanted to share. Looks like the problem is in code coverage. When you enable code coverage, it puts assemblies in different folder than usual (probably). So it copies the assemblies but not xml or any other file type. In order to solve the problem, double click Local.testsettings file in Solution Items, select "Deployment" on the left side, click "Add File" and choose hibernate.cfg.xml or any other file you want to be copied to the output directory. The problem should be gone now.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With