asp.net web api - Ninject dependency for Ninject.Web.WebApi.OwinHost v3.2.x -


i'm attempting ninject apicontrollers in azure worker role. i've accomplished ninjection same controllers in asp.net mvc 5 / web api 2 project in same solution. non ninjected test controller in workerrole project work , serve expected results.

while attempting add nuget package ninject.web.webapi.owinhost (version 3.2.x) looks package ?erroneously? requiring ninject version ≥ 3.0.0.0 && < 3.1.0.0

i've tried

install-package ninject.web.webapi.owinhost -projectname workerrole1 install-package ninject.web.webapi.owinhost -pre -projectname workerrole1 install-package ninject.web.webapi.owinhost -version 3.2.0 -projectname workerrole1 install-package ninject.web.webapi.owinhost -version 3.2.1-unstable-002 -projectname workerrole1 

i able add ninject.web.webapi.selfhost, believe need owin flavor , selfhost didn't appear install ninjectwebcommon.cs or equivalent. don't know wire ninject owin self host in worker role once successful @ including owinhost. i'm assuming scaffold-ed in.

result of attempting install ninject.web.webapi.owinhost

pm> install-package ninject.web.webapi.owinhost -pre -projectname workerrole1 attempting resolve dependency 'ninject.web.webapi (≥ 3.2.0-unstable)'. attempting resolve dependency 'ninject (≥ 3.2.0.0 && < 3.3.0.0)'. attempting resolve dependency 'ninject.web.common (≥ 3.2.0.0 && < 3.3.0.0)'. attempting resolve dependency 'microsoft.aspnet.webapi (≥ 5.0 && < 6.0)'. attempting resolve dependency 'microsoft.aspnet.webapi.webhost (≥ 5.1.2 && < 5.2.0)'. attempting resolve dependency 'microsoft.aspnet.webapi.core (≥ 5.1.2 && < 5.2.0)'. attempting resolve dependency 'microsoft.aspnet.webapi.client (≥ 5.1.2)'. attempting resolve dependency 'newtonsoft.json (≥ 4.5.11)'. attempting resolve dependency 'ninject.web.common.owinhost (≥ 3.0 && < 4.0)'. attempting resolve dependency 'ninject.extensions.contextpreservation (≥ 3.0 && < 4.0)'. attempting resolve dependency 'ninject (≥ 3.0.0.0 && < 3.1.0.0)'. install-package : updating 'ninject 3.2.2.0' 'ninject 3.0.1.10' failed. unable find versions of 'ninject.web.webapi, ninject.web.common' compatible 'ninject 3.0.1.10'. @ line:1 char:1 + install-package ninject.web.webapi.owinhost -pre -projectname workerrole1 + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~     + categoryinfo          : notspecified: (:) [install-package], invalidoperationexception     + fullyqualifiederrorid : nugetcmdletunhandledexception,nuget.powershell.commands.installpackagecommand  pm>  

probably unrelated in checking versions of installed package in workerrole note number of packages iis specific. these needed in azure workerrole owin self host? , microsoft.aspnet.webapi.selfhost see following notation yet have microsoft.aspnet.webapi.owinselfhost installed.

this legacy package hosting asp.net web api within own process (outside of iis). please use microsoft.aspnet.webapi.owinselfhost package new projects.

installed packages in workerrole

pm> get-package -projectname workerrole1  id                             version              description/release notes                                                                                                                                                                --                             -------              -------------------------                                                                                                                                                                entityframework                6.1.0                entity framework microsoft's recommended data access technology new applications.                                                                                                 microsoft.aspnet.identity.core 2.0.0                core interfaces asp.net identity.                                                                                                                                                    microsoft.aspnet.identity.e... 2.0.0                asp.net identity providers use entity framework.                                                                                                                                    microsoft.aspnet.webapi        5.0.0                package contains need host asp.net web api on iis. asp.net web api framework makes easy build http services reach broad range of client... microsoft.aspnet.webapi.client 5.1.2                package adds support formatting , content negotiation system.net.http. includes support json, xml, , form url encoded data.                                       microsoft.aspnet.webapi.core   5.1.2                package contains core runtime assemblies asp.net web api. package used hosts of asp.net web api runtime. host web api in iis use microsoft.aspne... microsoft.aspnet.webapi.owin   5.1.2                package allows host asp.net web api within owin server , provides access additional owin features.                                                                   microsoft.aspnet.webapi.owi... 5.1.2                package allows host asp.net web api within own process using owin httplistener server. asp.net web api framework makes easy build http services ... microsoft.aspnet.webapi.sel... 5.1.2                legacy package hosting asp.net web api within own process (outside of iis). please use microsoft.aspnet.webapi.owinselfhost package new projects.             microsoft.aspnet.webapi.web... 5.0.0                package contains need host asp.net web api on iis. asp.net web api framework makes easy build http services reach broad range of client... microsoft.data.edm             5.6.1                classes represent, construct, parse, serialize , validate entity data models. targets .net 4.0, silverlight 4.0, or .net portable lib support .net 4.0, sl 4.0, win pho... microsoft.data.odata           5.6.1                classes serialize, deserialize , validate odata payloads. enables construction of odata producers , consumers. targets .net 4.0, silverlight 4.0 or .net portable lib sup... microsoft.data.services.client 5.6.1                linq-enabled client api issuing odata queries , consuming odata payloads. supports odata v3. targets .net 4.0, silverlight 4.0 or .net portable lib support .net 4.5, ... microsoft.owin                 2.1.0                provides set of helper types , abstractions simplifying creation of owin components.                                                                                         microsoft.owin.diagnostics     2.1.0                provides middleware components assist in developing owin-based applications.                                                                                                          microsoft.owin.host.httplis... 2.1.0                owin server built on .net framework's httplistener class. default server used self-hosting.                                                                        microsoft.owin.hosting         2.1.0                provides default infrastructure types hosting , running owin-based applications.                                                                                                   microsoft.owin.selfhost        2.1.0                includes components needed host owin-based application in custom process.                                                                                                        microsoft.windowsazure.conf... 2.0.3                windows azure configuration manager provides unified api load configuration settings regardless of application hosted - whether on-premises or in cloud service.     newtonsoft.json                6.0.2                json.net popular high-performance json framework .net                                                                                                                           ninject                        3.2.2.0              stop writing monolithic applications make feel have move mountains make simplest of changes. ninject helps use technique of dependency injection ... ninject.web.common             3.2.0.0              bootstrapper web projects                                                                                                                                                            ninject.web.common.selfhost    3.2.0.0              adds self hosting support web common.                                                                                                                                                 ninject.web.webapi             3.2.0.0              extension ninject providing integration asp.net mvc webapi 2                                                                                                                    ninject.web.webapi.selfhost    3.2.0.0              extension ninject providing integration asp.net mvc webapi 2 selfhost                                                                                                           owin                           1.0                  owin iappbuilder startup interface                                                                                                                                                       system.spatial                 5.6.1                contains classes , methods facilitate geography , geometry spatial operations. targets .net 4.0, silverlight 4.0 or .net portable lib support .net 4.0, sl 4.0, win... windowsazure.storage           3.1.0.1              client library enables working windows azure storage services include blob service storing binary , text data, table service storing structured...  pm>  

i know late, ran same problem , found question via google search. got around -dependencyversion:

install-package ninject.web.webapi.owinhost -dependencyversion highest 

if don't want update of dependent nuget packages, found manually installing of ninject-related dependencies ninject.web.webapi.owinhost , installing ninject.web.webapi.owinhost got around issue.


Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -