Assembly Missing error when loading serialized object

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Daniel Reber

    #1

    Assembly Missing error when loading serialized object

    I have an exe that serializes one of it's classes to disk. I also have the
    exact same .cs file that contains the class that was serialized, in a
    Windows service application. I am trying to load that file every time the
    service starts. When I try to load it I get this error

    File or assembly name PXPJobSetup, or one of its dependencies was not found.

    I am not sure what I need to do.

    Thanks

    Dan Reber


  • Val Savvateev

    #2
    Re: Assembly Missing error when loading serialized object

    Make sure that you're referencing the assembly where the class of the
    serialized object is defined.
    It is not enough to just have that class redefined in your deserializing
    project.

    "Daniel Reber" <nospam@nospam. com> wrote in message
    news:OAueWQsWDH A.1888@TK2MSFTN GP10.phx.gbl...[color=blue]
    > I have an exe that serializes one of it's classes to disk. I also have[/color]
    the[color=blue]
    > exact same .cs file that contains the class that was serialized, in a
    > Windows service application. I am trying to load that file every time the
    > service starts. When I try to load it I get this error
    >
    > File or assembly name PXPJobSetup, or one of its dependencies was not[/color]
    found.[color=blue]
    >
    > I am not sure what I need to do.
    >
    > Thanks
    >
    > Dan Reber
    >
    >[/color]


    Comment

    • Daniel Reber

      #3
      Re: Assembly Missing error when loading serialized object

      Thanks for your help. I changed the one project to a Class Library and it
      works fine.
      By the way, what do you mean by "referencin g the assembly"

      Dan

      "Val Savvateev" <vsavvateev@mer idium.com_NO_SP AM> wrote in message
      news:#oORb8sWDH A.212@TK2MSFTNG P12.phx.gbl...[color=blue]
      > Make sure that you're referencing the assembly where the class of the
      > serialized object is defined.
      > It is not enough to just have that class redefined in your deserializing
      > project.
      >
      > "Daniel Reber" <nospam@nospam. com> wrote in message
      > news:OAueWQsWDH A.1888@TK2MSFTN GP10.phx.gbl...[color=green]
      > > I have an exe that serializes one of it's classes to disk. I also have[/color]
      > the[color=green]
      > > exact same .cs file that contains the class that was serialized, in a
      > > Windows service application. I am trying to load that file every time[/color][/color]
      the[color=blue][color=green]
      > > service starts. When I try to load it I get this error
      > >
      > > File or assembly name PXPJobSetup, or one of its dependencies was not[/color]
      > found.[color=green]
      > >
      > > I am not sure what I need to do.
      > >
      > > Thanks
      > >
      > > Dan Reber
      > >
      > >[/color]
      >
      >[/color]


      Comment

      • Val Savvateev

        #4
        Re: Assembly Missing error when loading serialized object

        Just what you did - you moved your "serializea ble" class into a separate
        assembly (class library) and now, I guess, both the exe app and the service
        are referencing that class library...

        "Daniel Reber" <nospam@nospam. com> wrote in message
        news:OPyTZJ2WDH A.1744@TK2MSFTN GP12.phx.gbl...[color=blue]
        > Thanks for your help. I changed the one project to a Class Library and it
        > works fine.
        > By the way, what do you mean by "referencin g the assembly"
        >
        > Dan
        >
        > "Val Savvateev" <vsavvateev@mer idium.com_NO_SP AM> wrote in message
        > news:#oORb8sWDH A.212@TK2MSFTNG P12.phx.gbl...[color=green]
        > > Make sure that you're referencing the assembly where the class of the
        > > serialized object is defined.
        > > It is not enough to just have that class redefined in your deserializing
        > > project.
        > >
        > > "Daniel Reber" <nospam@nospam. com> wrote in message
        > > news:OAueWQsWDH A.1888@TK2MSFTN GP10.phx.gbl...[color=darkred]
        > > > I have an exe that serializes one of it's classes to disk. I also[/color][/color][/color]
        have[color=blue][color=green]
        > > the[color=darkred]
        > > > exact same .cs file that contains the class that was serialized, in a
        > > > Windows service application. I am trying to load that file every time[/color][/color]
        > the[color=green][color=darkred]
        > > > service starts. When I try to load it I get this error
        > > >
        > > > File or assembly name PXPJobSetup, or one of its dependencies was not[/color]
        > > found.[color=darkred]
        > > >
        > > > I am not sure what I need to do.
        > > >
        > > > Thanks
        > > >
        > > > Dan Reber
        > > >
        > > >[/color]
        > >
        > >[/color]
        >
        >[/color]


        Comment

        • Daniel Reber

          #5
          Re: Assembly Missing error when loading serialized object

          That's correct, thanks for your help.

          Dan

          "Val Savvateev" <vsavvateev@mer idium.com_NO_SP AM> wrote in message
          news:eixyaZ2WDH A.3404@tk2msftn gp13.phx.gbl...[color=blue]
          > Just what you did - you moved your "serializea ble" class into a separate
          > assembly (class library) and now, I guess, both the exe app and the[/color]
          service[color=blue]
          > are referencing that class library...
          >
          > "Daniel Reber" <nospam@nospam. com> wrote in message
          > news:OPyTZJ2WDH A.1744@TK2MSFTN GP12.phx.gbl...[color=green]
          > > Thanks for your help. I changed the one project to a Class Library and[/color][/color]
          it[color=blue][color=green]
          > > works fine.
          > > By the way, what do you mean by "referencin g the assembly"
          > >
          > > Dan
          > >
          > > "Val Savvateev" <vsavvateev@mer idium.com_NO_SP AM> wrote in message
          > > news:#oORb8sWDH A.212@TK2MSFTNG P12.phx.gbl...[color=darkred]
          > > > Make sure that you're referencing the assembly where the class of the
          > > > serialized object is defined.
          > > > It is not enough to just have that class redefined in your[/color][/color][/color]
          deserializing[color=blue][color=green][color=darkred]
          > > > project.
          > > >
          > > > "Daniel Reber" <nospam@nospam. com> wrote in message
          > > > news:OAueWQsWDH A.1888@TK2MSFTN GP10.phx.gbl...
          > > > > I have an exe that serializes one of it's classes to disk. I also[/color][/color]
          > have[color=green][color=darkred]
          > > > the
          > > > > exact same .cs file that contains the class that was serialized, in[/color][/color][/color]
          a[color=blue][color=green][color=darkred]
          > > > > Windows service application. I am trying to load that file every[/color][/color][/color]
          time[color=blue][color=green]
          > > the[color=darkred]
          > > > > service starts. When I try to load it I get this error
          > > > >
          > > > > File or assembly name PXPJobSetup, or one of its dependencies was[/color][/color][/color]
          not[color=blue][color=green][color=darkred]
          > > > found.
          > > > >
          > > > > I am not sure what I need to do.
          > > > >
          > > > > Thanks
          > > > >
          > > > > Dan Reber
          > > > >
          > > > >
          > > >
          > > >[/color]
          > >
          > >[/color]
          >
          >[/color]


          Comment

          Working...