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

  • Home
  • SEARCH
  • 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 8909841
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T03:32:13+00:00 2026-06-15T03:32:13+00:00

I am developing a program which uses NHibernate and Spring.Net framework. When I execute

  • 0

I am developing a program which uses NHibernate and Spring.Net framework. When I execute the application, the following exception is thrown:

Error creating context ‘spring.root’: Could not load type from string value ‘BlackOpsP2.Data.EmployeeDao, BlackOpsP2.Data’.

app.config:

<?xml version="1.0"?>
<configuration> 
    <configSections>
        <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821"/>
        <sectionGroup name="spring">
            <section name="parsers" type="Spring.Context.Support.NamespaceParsersSectionHandler, Spring.Core" />
            <section name="context" type="Spring.Context.Support.ContextHandler, Spring.Core"/>
            <section name="objects" type="Spring.Context.Support.DefaultSectionHandler, Spring.Core" />
        </sectionGroup>
    </configSections>

    <spring>
        <context>
            <resource uri="config://spring/objects"/>
        </context>
        <parsers>
            <parser type="Spring.Data.Config.DatabaseNamespaceParser, Spring.Data" />
            <parser type="Spring.Transaction.Config.TxNamespaceParser, Spring.Data"/>
        </parsers>

        <objects xmlns="http://www.springframework.net"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xmlns:tx="http://www.springframework.net/tx"
             xmlns:db="http://www.springframework.net/database">

            <db:provider id="DbProvider"
                           provider="SqlServer-2.0"
                           connectionString="Data Source=CHETUIWK123\SQL2008R2;Integrated Security=true;Database=TestNhibernate;"/>
            <object id="MySessionFactory" type="Spring.Data.NHibernate.LocalSessionFactoryObject, Spring.Data.NHibernate33">
                <property name="ExposeTransactionAwareSessionFactory" value="true" />
                <property name="DbProvider" ref="DbProvider"/>
                <property name="MappingAssemblies">
                    <list>
                        <value>BlackOpsP2.Core</value>
                    </list>
                </property>
                <property name="HibernateProperties">
                    <dictionary>

                        <entry key="hibernate.connection.provider"
                               value="NHibernate.Connection.DriverConnectionProvider"/>

                        <entry key="dialect"
                               value="NHibernate.Dialect.MsSql2008Dialect"/>

                        <entry key="hibernate.connection.driver_class"
                               value="NHibernate.Driver.SqlClientDriver"/>

                    </dictionary>
                </property>
            </object>

            <object id="HibernateTransactionManager"
            type="Spring.Data.NHibernate.HibernateTransactionManager, Spring.Data.NHibernate33">
                <property name="SessionFactory" ref="MySessionFactory"/>
            </object>

            <object id="EmployeeDao" xsi:schemaLocation="" type="BlackOpsP2.Data.EmployeeDao, BlackOpsP2.Data">
                <property name="SessionFactory" ref="MySessionFactory"/>
            </object>

            <object id="EmployeeService" type="BlackOpsP2.Services.ARModule.EmployeeService, BlackOpsP2.Services">
                <property name="TransactionManager" ref="HibernateTransactionManager"/>
                <property name="Dao" ref="EmployeeDao"/>
            </object>

            <object id="EmployeeController" type="BlackOpsP2.Presentation.Controller.ARModule.EmployeeController, BlackOpsP2.Presentation">
                <property name="Service" ref="EmployeeService"/>
            </object>

            <!--> manually added -->
            <object id="Form" type="BlackOpsP2.UI.Form1, BlackOpsP2.UI">
                <property name="Controller" ref="EmployeeController"/>
            </object>
            <!--> /****/ -->

            <tx:attribute-driven transaction-manager="HibernateTransactionManager"/>
        </objects>
    </spring>

    <log4net>
        <appender name="FileAppender" type="log4net.Appender.FileAppender,log4net">
            <file value="E:\Test\log.txt"/>
            <appendToFile value="true"/>
            <lockingModel type="log4net.Appender.FileAppender+MinimalLock"/>
            <layout type="log4net.Layout.PatternLayout">
                <conversionPattern value="%date [%thread] %level %logger - %message%newline"/>
            </layout>
            <filter type="log4net.Filter.LevelRangeFilter">
                <levelMin value="INFO"/>
                <levelMax value="FATAL"/>
            </filter>
        </appender>

        <root>
            <level value="DEBUG"/>
            <appender-ref ref="FileAppender"/>
        </root>
    </log4net>
</configuration>

I have implemented following directory structure:

  1. ABC.Core
  2. ABC.Data
  3. ABC.Presentation
  4. ABC.Services
  5. ABC.UI

I have gone through a lot of links on stackoverflow and google, but I was unable to find relevant information which solves my problem.

I don’t know why this exception is thrown and I don’t know how to solve it. I think it may be something related to Output Directory or maybe Spring Framework cannot find dll’s.

Detailed trace exception:

System.Configuration.ConfigurationErrorsException was unhandled  
Message=Error creating context 'spring.root': Could not load type from
string value 'BlackOpsP2.Data.EmployeeDao, BlackOpsP2.Data'.  
Source=System.Configuration   BareMessage=Error creating context
'spring.root': Could not load type from string value
'BlackOpsP2.Data.EmployeeDao, BlackOpsP2.Data'.   Line=0   StackTrace:
       at System.Configuration.BaseConfigurationRecord.EvaluateOne(String[]
keys, SectionInput input, Boolean isTrusted, FactoryRecord
factoryRecord, SectionRecord sectionRecord, Object parentResult)
       at System.Configuration.BaseConfigurationRecord.Evaluate(FactoryRecord
factoryRecord, SectionRecord sectionRecord, Object parentResult,
Boolean getLkg, Boolean getRuntimeObject, Object& result, Object&
resultRuntimeObject)
       at System.Configuration.BaseConfigurationRecord.GetSectionRecursive(String
configKey, Boolean getLkg, Boolean checkPermission, Boolean
getRuntimeObject, Boolean requestIsHere, Object& result, Object&
resultRuntimeObject)
       at System.Configuration.BaseConfigurationRecord.GetSectionRecursive(String
configKey, Boolean getLkg, Boolean checkPermission, Boolean
getRuntimeObject, Boolean requestIsHere, Object& result, Object&
resultRuntimeObject)
       at System.Configuration.BaseConfigurationRecord.GetSectionRecursive(String
configKey, Boolean getLkg, Boolean checkPermission, Boolean
getRuntimeObject, Boolean requestIsHere, Object& result, Object&
resultRuntimeObject)
       at System.Configuration.BaseConfigurationRecord.GetSection(String
configKey)
       at System.Configuration.ClientConfigurationSystem.System.Configuration.Internal.IInternalConfigSystem.GetSection(String
sectionName)
       at System.Configuration.ConfigurationManager.GetSection(String sectionName)
       at Spring.Util.ConfigurationUtils.GetSection(String sectionName)
       at Spring.Context.Support.ContextRegistry.InitializeContextIfNeeded()
       at Spring.Context.Support.ContextRegistry.GetContext()
       at BlackOpsP2.UI.Program.Main() in E:\Project\BlackOps-P2\BlackOpsP2.UI\Program.cs:line 19
       at System.AppDomain._nExecuteAssembly(RuntimeAssembly 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, Boolean
ignoreSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()   InnerException: Spring.Core.CannotLoadObjectTypeException
       Message=Cannot resolve type [BlackOpsP2.Data.EmployeeDao, BlackOpsP2.Data] for object with name 'EmployeeDao' defined in config
[E:\Project\Bin\BlackOps-P2\BlackOpsP2.UI\BlackOpsP2.UI.vshost.exe.Config#spring/objects]
line 1
       Source=Spring.Core
       ObjectName=EmployeeDao
       ObjectTypeName=BlackOpsP2.Data.EmployeeDao, BlackOpsP2.Data
       ResourceDescription=config [E:\Project\Bin\BlackOps-P2\BlackOpsP2.UI\BlackOpsP2.UI.vshost.exe.Config#spring/objects]
line 1
       StackTrace:
            at Spring.Objects.Factory.Support.AbstractObjectFactory.ResolveObjectType(RootObjectDefinition
rod, String objectName)
            at Spring.Objects.Factory.Support.DefaultListableObjectFactory.PreInstantiateSingletons()
            at Spring.Context.Support.AbstractApplicationContext.Refresh()
            at Spring.Context.Support.XmlApplicationContext..ctor(XmlApplicationContextArgs
args)
            at Spring.Context.Support.XmlApplicationContext..ctor(String name,
Boolean caseSensitive, String[] configurationLocations)
            at _dynamic_Spring.Context.Support.XmlApplicationContext..ctor(Object[] )
            at Spring.Reflection.Dynamic.SafeConstructor.Invoke(Object[] arguments)
            at Spring.Context.Support.ContextHandler.RootContextInstantiator.InvokeContextConstructor(ConstructorInfo
ctor)
            at Spring.Context.Support.ContextHandler.ContextInstantiator.InstantiateContext()
            at Spring.Context.Support.ContextHandler.InstantiateContext(IApplicationContext
parentContext, Object configContext, String contextName, Type
contextType, Boolean caseSensitive, IList`1 resources)
            at Spring.Context.Support.ContextHandler.Create(Object parent, Object configContext, XmlNode section)
       InnerException: System.TypeLoadException
            Message=Could not load type from string value 'BlackOpsP2.Data.EmployeeDao, BlackOpsP2.Data'.
            Source=Spring.Core
            TypeName=""
            StackTrace:
                 at Spring.Core.TypeResolution.TypeResolver.Resolve(String typeName)
                 at Spring.Core.TypeResolution.GenericTypeResolver.Resolve(String
typeName)
                 at Spring.Core.TypeResolution.CachedTypeResolver.Resolve(String typeName)
                 at Spring.Core.TypeResolution.TypeResolutionUtils.ResolveType(String
typeName)
                 at Spring.Objects.Factory.Support.AbstractObjectDefinition.ResolveObjectType()
                 at Spring.Objects.Factory.Support.AbstractObjectFactory.ResolveObjectType(RootObjectDefinition
rod, String objectName)
            InnerException:

Update

When I add the following lines in app.config:

<property name="MappingAssemblies">
                <list>
                    <value>BlackOpsP2.Core</value>
                    <value>BlackOpsP2.Data</value>
                </list>
</property>

The error message changes as:

Error creating context ‘spring.root’: Could not load file or assembly ‘BlackOpsP2.Data’ or one of its dependencies. The system cannot find the file specified.

Does anybody know why it is happening?

  • 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-06-15T03:32:14+00:00Added an answer on June 15, 2026 at 3:32 am

    I have solved the problem. Actually there are two minor mistakes.

    1. Qualified entity name is incorrect.
    2. Need to add references of all dlls in UI dll.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am developing a large program which uses a lot of memory. The program
I'm developing an application that uses Qt 4.7 with the goal of creating a
i am developing a program which uses the android camera to take pictures. but
We are presently developing an application, let's call it APP1 , which uses a
I am developing an application in java for a mobile platform. The program uses
I'm developing a matlab program in which I uses polygons(concave or convex). I need
I am developing a program which uses visual styles. The Main method looks like
I am developing an application which uses file upload. My client uses Symantec End
I am developing an application that uses Entity Framework and WPF with MVVM design
I'm developing a program which allows users to input some information which then gets

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.