Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 861517
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T08:59:22+00:00 2026-05-15T08:59:22+00:00

public ApplicationView(string[] args) { InitializeComponent(); string configFilePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, log4net.config); FileInfo configFileInfo = new

  • 0
    public ApplicationView(string[] args)
    {
        InitializeComponent();

        string configFilePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "log4net.config");
        FileInfo configFileInfo = new FileInfo(configFilePath);
        XmlConfigurator.ConfigureAndWatch(configFileInfo);

        IConfigurationSource configSource = ConfigurationManager.GetSection("ActiveRecord") as IConfigurationSource;
        Assembly assembly = Assembly.Load("Danel.Nursing.Model");
        ActiveRecordStarter.Initialize(assembly, configSource);         

        WindsorContainer windsorContainer = ApplicationUtils.GetWindsorContainer();
        windsorContainer.Kernel.AddComponentInstance<ApplicationView>(this);
        windsorContainer.Kernel.AddComponent(typeof(ApplicationController).Name, typeof(ApplicationController));
        controller = windsorContainer.Resolve<ApplicationController>(); // exception is thrown here

        OnApplicationLoad(args);
    }

The stack trace is this:

Castle.MicroKernel.ComponentActivator.ComponentActivatorException
was unhandled
Message=”ComponentActivator: could not
instantiate
Danel.Nursing.Scheduling.Actions.DataServices.NurseAbsenceDataService”
Source=”Castle.MicroKernel”
StackTrace:
at Castle.MicroKernel.ComponentActivator.DefaultComponentActivator.CreateInstance(CreationContext
context, Object[] arguments, Type[]
signature)
at Castle.MicroKernel.ComponentActivator.DefaultComponentActivator.Instantiate(CreationContext
context)
at Castle.MicroKernel.ComponentActivator.DefaultComponentActivator.InternalCreate(CreationContext
context)
at Castle.MicroKernel.ComponentActivator.AbstractComponentActivator.Create(CreationContext
context)
at Castle.MicroKernel.Lifestyle.AbstractLifestyleManager.Resolve(CreationContext
context)
at Castle.MicroKernel.Lifestyle.SingletonLifestyleManager.Resolve(CreationContext
context)
at Castle.MicroKernel.Handlers.DefaultHandler.Resolve(CreationContext
context)
at Castle.MicroKernel.Resolvers.DefaultDependencyResolver.ResolveServiceDependency(CreationContext
context, ComponentModel model,
DependencyModel dependency)
at Castle.MicroKernel.Resolvers.DefaultDependencyResolver.Resolve(CreationContext
context, ISubDependencyResolver
parentResolver, ComponentModel model,
DependencyModel dependency)
at Castle.MicroKernel.ComponentActivator.DefaultComponentActivator.CreateConstructorArguments(ConstructorCandidate
constructor, CreationContext context,
Type[]& signature)
at Castle.MicroKernel.ComponentActivator.DefaultComponentActivator.Instantiate(CreationContext
context)
at Castle.MicroKernel.ComponentActivator.DefaultComponentActivator.InternalCreate(CreationContext
context)
at Castle.MicroKernel.ComponentActivator.AbstractComponentActivator.Create(CreationContext
context)
at Castle.MicroKernel.Lifestyle.AbstractLifestyleManager.Resolve(CreationContext
context)
at Castle.MicroKernel.Lifestyle.SingletonLifestyleManager.Resolve(CreationContext
context)
at Castle.MicroKernel.Handlers.DefaultHandler.Resolve(CreationContext
context)
at Castle.MicroKernel.Resolvers.DefaultDependencyResolver.ResolveServiceDependency(CreationContext
context, ComponentModel model,
DependencyModel dependency)
at Castle.MicroKernel.Resolvers.DefaultDependencyResolver.Resolve(CreationContext
context, ISubDependencyResolver
parentResolver, ComponentModel model,
DependencyModel dependency)
at Castle.MicroKernel.ComponentActivator.DefaultComponentActivator.CreateConstructorArguments(ConstructorCandidate
constructor, CreationContext context,
Type[]& signature)
at Castle.MicroKernel.ComponentActivator.DefaultComponentActivator.Instantiate(CreationContext
context)
at Castle.MicroKernel.ComponentActivator.DefaultComponentActivator.InternalCreate(CreationContext
context)
at Castle.MicroKernel.ComponentActivator.AbstractComponentActivator.Create(CreationContext
context)
at Castle.MicroKernel.Lifestyle.AbstractLifestyleManager.Resolve(CreationContext
context)
at Castle.MicroKernel.Lifestyle.SingletonLifestyleManager.Resolve(CreationContext
context)
at Castle.MicroKernel.Handlers.DefaultHandler.Resolve(CreationContext
context)
at Castle.MicroKernel.Resolvers.DefaultDependencyResolver.ResolveServiceDependency(CreationContext
context, ComponentModel model,
DependencyModel dependency)
at Castle.MicroKernel.Resolvers.DefaultDependencyResolver.Resolve(CreationContext
context, ISubDependencyResolver
parentResolver, ComponentModel model,
DependencyModel dependency)
at Castle.MicroKernel.ComponentActivator.DefaultComponentActivator.CreateConstructorArguments(ConstructorCandidate
constructor, CreationContext context,
Type[]& signature)
at Castle.MicroKernel.ComponentActivator.DefaultComponentActivator.Instantiate(CreationContext
context)
at Castle.MicroKernel.ComponentActivator.DefaultComponentActivator.InternalCreate(CreationContext
context)
at Castle.MicroKernel.ComponentActivator.AbstractComponentActivator.Create(CreationContext
context)
at Castle.MicroKernel.Lifestyle.AbstractLifestyleManager.Resolve(CreationContext
context)
at Castle.MicroKernel.Lifestyle.SingletonLifestyleManager.Resolve(CreationContext
context)
at Castle.MicroKernel.Handlers.DefaultHandler.Resolve(CreationContext
context)
at Castle.MicroKernel.DefaultKernel.ResolveComponent(IHandler
handler, Type service, IDictionary
additionalArguments)
at Castle.MicroKernel.DefaultKernel.ResolveComponent(IHandler
handler, Type service)
at Castle.MicroKernel.DefaultKernel.get_Item(Type
service)
at Castle.Windsor.WindsorContainer.Resolve(Type
service)
at Castle.Windsor.WindsorContainer.ResolveT
at Danel.Nursing.Scheduling.ApplicationView..ctor(String[]
args) in
E:\Agile\Scheduling\Danel.Nursing.Scheduling\ApplicationView.cs:line
65
at Danel.Nursing.Scheduling.Program.Main(String[]
args) in
E:\Agile\Scheduling\Danel.Nursing.Scheduling\Program.cs:line
24
at System.AppDomain._nExecuteAssembly(Assembly
assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String
assemblyFile, Evidence
assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object
state)
at System.Threading.ExecutionContext.Run(ExecutionContext
executionContext, ContextCallback
callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException:
System.ArgumentNullException
Message=”Value cannot be null.\r\nParameter name: types”
Source=”mscorlib”
ParamName=”types”
StackTrace:
at System.Type.GetConstructor(BindingFlags
bindingAttr, Binder binder, Type[]
types, ParameterModifier[] modifiers)
at Castle.MicroKernel.ComponentActivator.DefaultComponentActivator.FastCreateInstance(Type
implType, Object[] arguments, Type[]
signature)
at Castle.MicroKernel.ComponentActivator.DefaultComponentActivator.CreateInstance(CreationContext
context, Object[] arguments, Type[]
signature)
InnerException:

It actually says that the type that I’m trying to initialize does not exist, I think.
This is the concreate type that it complains about:

   namespace Danel.Nursing.Scheduling.Actions.DataServices
    {
        using System;
        using Helpers;
        using Rhino.Commons;
        using Danel.Nursing.Model;
        using NHibernate.Expressions;
        using System.Collections.Generic;
        using DateUtil = Danel.Nursing.Scheduling.Actions.Helpers.DateUtil;
        using Danel.Nursing.Scheduling.Actions.DataServices.Interfaces;

        public class NurseAbsenceDataService : AbstractDataService<NurseAbsence>, INurseAbsenceDataService
        {
            NurseAbsenceDataService(IRepository<NurseAbsence> repository)
                : base(repository)
            {
            }

            //...
        }
    }

The AbstractDataService only holds the IRepository for now.
Anyone got an idea why the exception is thrown?

EDIT:
The problem lays here:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Danel.Nursing.Scheduling.Actions.Interfaces;
using Rhino.Commons;
using System.Reflection;
using Castle.Windsor;

namespace Danel.Nursing.Scheduling.Actions.Helpers
{
    public class DataServicesInitiator : IDataServicesInitiator
    {
        public void AddToIocContainer(ref WindsorContainer windsorContainer)
        {
            if (windsorContainer.Kernel.HasComponent(typeof(IRepository<>)) == false)
                windsorContainer.AddComponent(typeof(ARRepository<>).FullName, typeof(IRepository<>), typeof(ARRepository<>));
            foreach (Type type in Assembly.Load("Danel.Nursing.Scheduling.Actions").GetTypes())
            {
                if (type == null)
                    continue;

                if (type.Namespace != "Danel.Nursing.Scheduling.Actions.DataServices")
                    continue;

                if (type.IsAbstract || type.IsInterface)
                    continue;

                if (windsorContainer.Kernel.HasComponent(type.FullName))
                    continue;

                if (type.GetInterfaces().Length == 0)
                    windsorContainer.AddComponent(type.FullName, type);
                else
                    windsorContainer.AddComponent(type.FullName, type.GetInterfaces()[0], type);
            }
        }
    }
}

For some reason type is null although GetTypes return no null types.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T08:59:23+00:00Added an answer on May 15, 2026 at 8:59 am

    What does the inner exception say? It looks like the constructor for the type threw an exception or it was unable to properly call the constructor for some other reason…

    Update

    You can get everything – ActiveRecord, Windsor with MicroKernel, DynamicProxy and NHibernate
    by downloading ActiveRecord package. It’s all there.

    If you don’t want to update you may take alternative approach – write a custom Activator for this component (inherit from the default one and override the method which exposes the bug.)
    This should be the safest workaround.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

public static void main(String[] args) { int i = 0; while(i==0){ System.out.println(Possibilities: R, T,
public class Test { public static void main(String[] args) { DemoAbstractClass abstractClass = new
public static void main(String[] args) { staples[] stemp = new staples[8]; int j; try
public class Employee { public static void main(String[] args) { int j=3; staples[] stemp
public class InterruptedInput { public static void main(String[] args) { InputThread th=new InputThread(); //worker
public class Test { public static void main(String[] args) throws Exception { String s1
public class Main { public static void main (String args[]) { int nums[]= {2,
public static void main(String[] args) { int count, innerCount; for(count=0;count<=3;count++) { System.out.println(Count is +
public static void main(String[] args) { List<? extends Object> mylist = new ArrayList<Object>(); mylist.add(Java);
public class Test { public static void main(String[] args) { } } class Outer

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.