Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Field not found: 'Nancy.Bootstrapper.NancyBootstrapperLocator.Bootstrapper'

i recently have been using Nancy fx and i'm in love with it, but when i try to make a structuremap ioc like the documentation page suggested i get the error

Field not found: 'Nancy.Bootstrapper.NancyBootstrapperLocator.Bootstrapper'.

i have override the getApplicationContainer function like shown in the file

https://github.com/CarlosBolanos/apadrina/blob/master/Application/Bootstrapper.cs

but still get the same error, i look on the code on the rnancy repository https://github.com/NancyFx/Nancy.Bootstrappers.StructureMap/blob/master/src/Nancy.Bootstrappers.StructureMap/StructureMapNancyBootstrapper.cs and i cant see the bootstrapper property

does any1 else have this error too i've been trying to set this up for hours, if i remove the nancystructuremap in nugget the error goes away.

or do i need to set something else on the bootstrap class.

like image 559
Carlos Guillermo Bolaños Lopez Avatar asked Aug 19 '14 01:08

Carlos Guillermo Bolaños Lopez


1 Answers

I ran into this scenario after installing Nancy.Bootstrappers.Ninject from Nuget. My Nancy project was created using the Nancy Visual Studio templates, and were referencing Nancy 0.21.1.

What I found was installing the bootstrapper package caused the base Nancy package to get upgraded from 0.21.1 to 0.23.2. This is fine, except that the Nancy.Hosting.Aspnet and the Razor engine packages were NOT upgraded from 0.21.1.

To fix the error, I had to update all of the Nancy-related packages I was using to match the 0.23.2 package.

like image 65
kenchilada Avatar answered Nov 19 '22 16:11

kenchilada