Update: For anybody that was interested or has a similar problem, it turned out that it was an issue with IntelliTrace. it was enabled on for the deployments that through the invalid program exception, and disabling it and redeploying fixed the issue.
On Sunday, July 13, 2014 4:51:55 PM UTC+1, Ben Hortop wrote: > > Yes, It works locally on my machine. > It only fails when published it Azure. > > I raised a support ticket with Microsoft, the support engineer was unable > to repeat the issue when he deployed it (the service started correctly), > but he could see it failing on my deployment, and as far as we could tell > the deployments were identical, so its been escalated to the CLR team. I'll > feed back any resolution in-case its helpful for anybody else. > > On Saturday, July 12, 2014 4:10:14 PM UTC+1, hammett wrote: >> >> Is there an exception message when it throws it? My guess it's having >> some issues with the IL generated. Does it work locally in your >> machine? >> >> On Thu, Jul 10, 2014 at 1:11 PM, Ben Hortop <[email protected]> >> wrote: >> > Sorry if this appears twice, I had a problem posting. >> > >> > Hi, >> > I had a problem deploying a web role to Azure (v2.3) using Castle >> Windsor. >> > When adding the TypedFactoryFacility to a WinsorContainer the web role >> would >> > throw an InvalidProgramException. I was able to “resolve” the issue by >> > deleting the deployment and creating a new solution from scratch and >> then >> > deploying that (there is an associated question on StackOverflow - >> > http://stackoverflow.com/q/24461848/3784807) >> > Now I’m trying to deploy a Worker Role and I’m getting the same >> problem. >> > I’ve been able to recreate the issue with the standard background >> worker >> > role template (VS2013), then using NuGet to add a reference to Castle >> > Windsor 3.3.0, then adding the following code to the worker roles run >> method >> > >> > var windsorContainer = new WindsorContainer(); >> > windsorContainer.AddFacility<TypedFactoryFacility>(); >> > >> > The AddFacility call eventually (the stack trace is below) throws the >> > Invalid Program Exception. Frustratingly the code works perfectly on my >> PC, >> > but not when I deploy it to Azure. I’m stuck. Is anybody able to deploy >> a >> > worker role to Azure with Castle Windsor 3.3.0? or does anybody have >> any >> > ideas as to what might be wrong? >> > >> > STACK TRACE: >> > >> Castle.Windsor.dll!Castle.Core.ComponentModel.AddConstructor(Castle.Core.ConstructorCandidate >> >> >> > constructor = {Castle.Core.ConstructorCandidate}) C# >> > >> > >> Castle.Windsor.dll!Castle.MicroKernel.ModelBuilder.Inspectors.ConstructorDependenciesModelInspector.ProcessModel(Castle.MicroKernel.IKernel >> >> >> > kernel = {Castle.MicroKernel.DefaultKernel}, Castle.Core.ComponentModel >> > model = {Castle.Core.ComponentModel}) C# >> > >> > >> Castle.Windsor.dll!<>c__DisplayClass6.AnonymousMethod(Castle.MicroKernel.ModelBuilder.IContributeComponentModelConstruction >> >> >> > c = >> > >> {Castle.MicroKernel.ModelBuilder.Inspectors.ConstructorDependenciesModelInspector}) >> >> >> > C# >> > >> > >> CommonLanguageRuntimeLibrary!System.Collections.Generic.List`1.ForEach(System.Action >> >> >> > action = {unknown}) C# >> > >> > >> Castle.Windsor.dll!Castle.MicroKernel.ModelBuilder.DefaultComponentModelBuilder.BuildModel(Castle.MicroKernel.ModelBuilder.IComponentModelDescriptor[] >> >> >> > customContributors = >> > {Castle.MicroKernel.ModelBuilder.IComponentModelDescriptor[2]}) C# >> > >> > >> Castle.Windsor.dll!Castle.MicroKernel.Registration.ComponentRegistration`1.Castle.MicroKernel.Registration.IRegistration.Register(Castle.MicroKernel.IKernelInternal >> >> >> > kernel = {Castle.MicroKernel.DefaultKernel}) C# >> > >> > >> Castle.Windsor.dll!Castle.MicroKernel.DefaultKernel.Register(Castle.MicroKernel.Registration.IRegistration[] >> >> >> > registrations = {Castle.MicroKernel.Registration.IRegistration[4]}) C# >> > >> > >> Castle.Windsor.dll!Castle.Facilities.TypedFactory.TypedFactoryFacility.InitFacility() >> >> >> > C# >> > >> > >> Castle.Windsor.dll!Castle.Facilities.TypedFactory.TypedFactoryFacility.Init() >> >> >> > C# >> > >> > >> Castle.Windsor.dll!Castle.MicroKernel.Facilities.AbstractFacility.Castle.MicroKernel.IFacility.Init(Castle.MicroKernel.IKernel >> >> >> > kernel = {Castle.MicroKernel.DefaultKernel}, >> > Castle.Core.Configuration.IConfiguration facilityConfig = null) C# >> > >> Castle.Windsor.dll!Castle.MicroKernel.DefaultKernel.AddFacility(string key >> > = "Castle.Facilities.TypedFactory.TypedFactoryFacility", >> > Castle.MicroKernel.IFacility facility = >> > {Castle.Facilities.TypedFactory.TypedFactoryFacility}) C# >> > >> > >> Castle.Windsor.dll!Castle.MicroKernel.DefaultKernel.AddFacility(Castle.MicroKernel.IFacility >> >> >> > facility = {Castle.Facilities.TypedFactory.TypedFactoryFacility}) C# >> > Castle.Windsor.dll!Castle.MicroKernel.DefaultKernel.AddFacility() C# >> > Castle.Windsor.dll!Castle.Windsor.WindsorContainer.AddFacility() C# >> > WorkerRole1.dll!WorkerRole1.WorkerRole.Run() C# >> > >> > Would really appreciate any help. >> > >> > Thanks, Ben. >> > >> > -- >> > You received this message because you are subscribed to the Google >> Groups >> > "Castle Project Users" group. >> > To unsubscribe from this group and stop receiving emails from it, send >> an >> > email to [email protected]. >> > To post to this group, send email to [email protected]. >> > Visit this group at http://groups.google.com/group/castle-project-users. >> >> > For more options, visit https://groups.google.com/d/optout. >> >> >> >> -- >> Cheers, >> hammett >> http://www.d-collab.com/ >> http://www.hammettblog.com/ >> > -- You received this message because you are subscribed to the Google Groups "Castle Project Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/castle-project-users. For more options, visit https://groups.google.com/d/optout.
