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. WCF InvalidCastException - "from in the context ['Default' | 'LoadFrom'] at location"

WCF InvalidCastException - "from in the context ['Default' | 'LoadFrom'] at location"

Scheduled Pinned Locked Moved C#
csharpwpfwcfcomdebugging
4 Posts 4 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.
  • 1 Offline
    1 Offline
    1eyhk1
    wrote on last edited by
    #1

    hello - any idea on this sort of exception? + [System.InvalidCastException] {" [A]MyLib.SomeAccount cannot be cast to [B]MyLib.SomeAccount. Type A originates from in the context 'Default' at location 'Y:\\MySrcCode\\FolderA\\Debug\\MyAcct.dll'. Type B originates from 'MyLib, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' in the context 'LoadFrom' at location 'Y:\\MySrcCode\\FolderB\\Debug\\MyAcct.dll'."} System.InvalidCastException Note, class exactly the same... but folder different ... how to resolve...? This may be hint but...[^] Another hint here[^]

    L realJSOPR M 3 Replies Last reply
    0
    • 1 1eyhk1

      hello - any idea on this sort of exception? + [System.InvalidCastException] {" [A]MyLib.SomeAccount cannot be cast to [B]MyLib.SomeAccount. Type A originates from in the context 'Default' at location 'Y:\\MySrcCode\\FolderA\\Debug\\MyAcct.dll'. Type B originates from 'MyLib, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' in the context 'LoadFrom' at location 'Y:\\MySrcCode\\FolderB\\Debug\\MyAcct.dll'."} System.InvalidCastException Note, class exactly the same... but folder different ... how to resolve...? This may be hint but...[^] Another hint here[^]

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Those are two different classes, in two different assemblies. They may look the same, the may have the same implementation; but they're not the same class.

      I are Troll :suss:

      1 Reply Last reply
      0
      • 1 1eyhk1

        hello - any idea on this sort of exception? + [System.InvalidCastException] {" [A]MyLib.SomeAccount cannot be cast to [B]MyLib.SomeAccount. Type A originates from in the context 'Default' at location 'Y:\\MySrcCode\\FolderA\\Debug\\MyAcct.dll'. Type B originates from 'MyLib, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' in the context 'LoadFrom' at location 'Y:\\MySrcCode\\FolderB\\Debug\\MyAcct.dll'."} System.InvalidCastException Note, class exactly the same... but folder different ... how to resolve...? This may be hint but...[^] Another hint here[^]

        realJSOPR Offline
        realJSOPR Offline
        realJSOP
        wrote on last edited by
        #3

        Use the WCF forum for WCF questions.

        .45 ACP - because shooting twice is just silly
        -----
        "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
        -----
        "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001

        1 Reply Last reply
        0
        • 1 1eyhk1

          hello - any idea on this sort of exception? + [System.InvalidCastException] {" [A]MyLib.SomeAccount cannot be cast to [B]MyLib.SomeAccount. Type A originates from in the context 'Default' at location 'Y:\\MySrcCode\\FolderA\\Debug\\MyAcct.dll'. Type B originates from 'MyLib, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' in the context 'LoadFrom' at location 'Y:\\MySrcCode\\FolderB\\Debug\\MyAcct.dll'."} System.InvalidCastException Note, class exactly the same... but folder different ... how to resolve...? This may be hint but...[^] Another hint here[^]

          M Offline
          M Offline
          Matthew Smith
          wrote on last edited by
          #4

          Here's a common way that the problem can be reproduced: How to reproduce InvalidCastException when binding to an assembly in the LoadFrom context

          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