c# - "Common Language Runtime detected an invalid program" on Azure Web Role with Castle Windsor -


i have web role works on development pc (vs2013 & window 8.1 enterprise x64), fails when publish azure following exception:

[invalidprogramexception: common language runtime detected invalid program.]    castle.core.componentmodel.get_dependencies() +0    castle.core.componentmodel.addconstructor(constructorcandidate constructor) +264    castle.microkernel.modelbuilder.inspectors.constructordependenciesmodelinspector.processmodel(ikernel kernel, componentmodel model) +535    castle.microkernel.modelbuilder.<>c__displayclass6.<buildmodel>b__4(icontributecomponentmodelconstruction c) +137    system.collections.generic.list`1.foreach(action`1 action) +95    castle.microkernel.modelbuilder.defaultcomponentmodelbuilder.buildmodel(icomponentmodeldescriptor[] customcontributors) +404    castle.microkernel.registration.componentregistration`1.castle.microkernel.registration.iregistration.register(ikernelinternal kernel) +283    castle.microkernel.defaultkernel.register(iregistration[] registrations) +198    castle.facilities.typedfactory.typedfactoryfacility.initfacility() +745    castle.facilities.typedfactory.typedfactoryfacility.init() +78    castle.microkernel.facilities.abstractfacility.castle.microkernel.ifacility.init(ikernel kernel, iconfiguration facilityconfig) +165    castle.microkernel.defaultkernel.addfacility(string key, ifacility facility) +507    castle.microkernel.defaultkernel.addfacility(ifacility facility) +213    castle.microkernel.defaultkernel.addfacility() +167    castle.windsor.windsorcontainer.addfacility() +138    pingtree.journey.webrole.iocconfig.registercomponents() in d:\users\ben\onedrive\source\pingtree\journeywebrole\pingtree.journey.webrole\app_start\iocconfig.cs:19    pingtree.journey.webrole.mvcapplication.application_start() in d:\users\ben\onedrive\source\pingtree\journeywebrole\pingtree.journey.webrole\global.asax.cs:15  [httpexception (0x80004005): common language runtime detected invalid program.]    system.web.httpapplicationfactory.ensureappstartcalledforintegratedmode(httpcontext context, httpapplication app) +475    system.web.httpapplication.registereventsubscriptionswithiis(intptr appcontext, httpcontext context, methodinfo[] handlers) +214    system.web.httpapplication.initspecial(httpapplicationstate state, methodinfo[] handlers, intptr appcontext, httpcontext context) +203    system.web.httpapplicationfactory.getspecialapplicationinstance(intptr appcontext, httpcontext context) +313    system.web.hosting.pipelineruntime.initializeapplication(intptr appcontext) +250  [httpexception (0x80004005): common language runtime detected invalid program.]    system.web.httpruntime.firstrequestinit(httpcontext context) +452    system.web.httpruntime.ensurefirstrequestinit(httpcontext context) +99    system.web.httpruntime.processrequestnotificationprivate(iis7workerrequest wr, httpcontext context) +1017 

the code registercomponents method is

public static void registercomponents() {     var assemblypath = path.combine(system.appdomain.currentdomain.basedirectory, "bin");      var windsorcontainer = new windsorcontainer();     windsorcontainer.addfacility<typedfactoryfacility>();     windsorcontainer.install(fromassembly.indirectory(new assemblyfilter(assemblypath)));     windsorcontainer.register(classes.fromthisassembly().basedon<icontroller>().lifestyletransient());      controllerbuilder.current.setcontrollerfactory(new windsorcontrollerfactory(windsorcontainer)); } 

its failing on windsorcontainer.addfacility method call.

i've tried usual things, used nuget remove castle.windsor project, deleted local copy , reinstalled windsor. answer here suggested deleting local temporary asp.net files, i've tried well. every time publish same problem.

update 1 i've been able reproduce problem boiler plate azure web role template , following code

    protected void application_start()     {         var windsorcontainer = new windsorcontainer();         windsorcontainer.addfacility<typedfactoryfacility>();     } 

is using castle windsor 3.3 on azure without problems?

a more specific answer seems problem intellitrace. deployments throw invalid program exception, had intellitrace enabled. disabling intellitrace , redeploying solution, , role initialised , started correctly.


Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

jsf - How to ajax update an item in the footer of a PrimeFaces dataTable? -

django - CSRF verification failed. Request aborted. CSRF cookie not set -