Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Invalid Cast Problem using Enterprise Library MS DAAB (with dynamic dll loading)

Invalid Cast Problem using Enterprise Library MS DAAB (with dynamic dll loading)

Scheduled Pinned Locked Moved C#
helpworkspace
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    Pankaj Chamria
    wrote on last edited by
    #1

    Hi, I am loading a dll say XYZ.dll dynamically from console application by using activator.createinstance() method. This XYZ.dll is having reference to a data access layer ABC.dll which has reference to the 3 MS-DAAB dlls of enterprise library: 1. Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSettings 2. Microsoft.Practices.EnterpriseLibrary.Data 3. Microsoft.Practices.ObjectBuilder I have placed these 3 dlls and ABC.dll in the folder with the exe of console application. However XYZ.dll is not placed there as it will be loaded at runtime specifying a certain path. Now when I try using code which uses the MS DAAB dlls then I am getting an error: Unable to cast object of type 'Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSettings' to type 'Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSettings' (I do not get this error when I am not dynalically loading the dll) Note: I have specified the dataConfiguration section in App.config of Console Application. Any help is appreciated.

    Pankaj Chamria, Software Programmer.

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups