Hi,
I had a problem when publishing a web role to Azure where the role would 
throw an InvalidProgramException when trying to add the 
TypedFactoryFacility to a windsor container.
I managed to "resolve" the issue by deleting the deployment and recreating 
the visual studio solution, and then deploying that. (there is an 
associated question on stack overflow 
http://stackoverflow.com/questions/24461848/common-language-runtime-detected-an-invalid-program-on-azure-web-role-with-cas/24630248#24630248
 
)

However, I'm now trying to deploy a background worker role, and I'm getting 
the same problem. But this time, deleting the deployment and recreating 
hasn't fixed the problem.
I've been able to recreate the issue using the boiler plate background 
worker role template, using NuGet to add a reference to Castle Windsor 
3.3.0 and adding the following code to the WorkerRole run method.

            var windsorContainer = new WindsorContainer();
            windsorContainer.AddFacility<TypedFactoryFacility>();

Frustratingly the code works perfectly on my local machine, but not when 
deployed to a new azure worker role. I'm convinced its something I've got 
wrong, but I can't work out what it is. Has anybody else seen this problem? 
or been able to deploy a worker role with Castle 3.3.0?

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#

Thanks, for any help.
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.

Reply via email to