我刚刚将基于 MVC 的 Web 服务部署到 Azure。它在专用服务器上运行良好。它使用 Ninject。
部署到 Azure 时,我收到以下错误:
The IControllerFactory 'xxx.NinjectControllerFactory' did not return a controller for the name '<DeploymentName>'.
where ;是生产部署的名称(或托管服务 - 两者具有相同的名称) - 这看起来有点奇怪。
我正在使用 NuGet 的最新版本的 Ninject (2.2.0.0)。我的理解是 1.x 中存在中等信任问题,但 2.x 中没有。
谁能指出我在这方面的正确方向?正如我所说,它在非 Azure 部署中运行良好 - 而且我在许多 MVC 3 Web 应用程序中使用了相同的代码,没有出现任何问题,因此它看起来确实像是某些特定于 Azure 的问题。
I've just deployed an MVC-based web service to Azure. It's been running fine on a dedicated server. It uses Ninject.
When deployed to Azure, I'm getting the following error:
The IControllerFactory 'xxx.NinjectControllerFactory' did not return a controller for the name '<DeploymentName>'.
where <DeploymentName> is the name of the production deployment (or hosted service - both have the same name) - which seems a little weird.
I'm using the latest version of Ninject from NuGet (2.2.0.0). My understanding was that there was a medium trust issue in 1.x, but not in 2.x.
Can anyone point me in the right direction on this one? As I said, it works fine in the non-Azure deployment - and I've used the same code in numerous MVC 3 web apps with no problems, so it does look like some Azure-specific issue.
发布评论
评论(1)
我知道一些使用 Ninject.MVC3 的项目在 Azure 上成功运行。您应该尝试使用此扩展,而不是实现您自己的
NinjectControllerFactory
。否则问题很可能出在您的 ControllerFactory 而不是 Ninject。I know that some projects run successfully on Azure that use Ninject.MVC3. You should try to use this extension rather than implement you own
NinjectControllerFactory
. Otherwise the problem is most likely in your ControllerFactory and not Ninject.