Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Ninject Extension Issue
Silvenga
#1 Posted : Monday, January 25, 2016 4:07:20 AM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 1/24/2016(UTC)
Posts: 40
Location: United States of America

Was thanked: 3 time(s) in 3 post(s)
I'm running into an odd issue when writing some integration tests targeting an in-memory Owin web server with Ninject. The error is as follows:

Code:

System.InvalidOperationException: This module requires Ninject.Web.WebAPI extension


I call it odd because R#'s test runner runs the test just fine.

It appears the issue might stem from Ninject's assembly scan for extensions (e.g. the one above) per a R# issue discussed here (https://devnet.jetbrains.com/thread/475198). The workaround in the second post does allow NCrunch to finish the tests correctly. This issue was resolved in R# 10.0.1.

I am currently running NCrunch v2.20.0.2 as I'm using VS15 with .Net 4.6.1 under Windows 10 (from http://forum.ncrunch.net...ET-framework-4-6-1.aspx).
Remco
#2 Posted : Monday, January 25, 2016 6:08:47 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,144

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
Hi, thanks for sharing this issue.

My first guess here is that the tests have a dependency on the Ninject assemblies being co-located with the test assembly. Does turning on the 'Copy referenced assemblies to workspace' NCrunch configuration setting for all the projects involved make any difference here?

More information about this - http://www.ncrunch.net/documentation/considerations-and-constraints_assembly-colocation-assumptions.
Silvenga
#3 Posted : Monday, January 25, 2016 5:07:12 PM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 1/24/2016(UTC)
Posts: 40
Location: United States of America

Was thanked: 3 time(s) in 3 post(s)
Setting the "Copy referenced assemblies to workspace" on the test and the project using Ninject does not appear to make a difference.
Remco
#4 Posted : Monday, January 25, 2016 9:07:42 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,144

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
Has this extension been installed via Nuget? If so, it's possible that it has an implicit dependency on files from the Nuget package.

Try adding the .nuget directory to your solution-level 'Additional files to include' NCrunch configuration setting. Also, make sure that the 'Copy referenced assemblies to workspace' setting is turned on for ALL the projects in your solution.

If you are using a configuration file of some kind that is required for Ninject, also try including this in the 'Additional files to include' for the project using this file.
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAF | YAF © 2003-2011, Yet Another Forum.NET
This page was generated in 0.029 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download