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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. [Message Deleted]

[Message Deleted]

Scheduled Pinned Locked Moved ASP.NET
7 Posts 3 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.
  • M Offline
    M Offline
    Muruvet Kaplan
    wrote on last edited by
    #1

    [Message Deleted]

    N S M 3 Replies Last reply
    0
    • M Muruvet Kaplan

      [Message Deleted]

      N Offline
      N Offline
      N a v a n e e t h
      wrote on last edited by
      #2

      Muruvet Kaplan wrote:

      cannot be serialized because it does not have a parameterless constructor.

      That error message is clear right?

      Navaneeth How to use google | Ask smart questions

      1 Reply Last reply
      0
      • M Muruvet Kaplan

        [Message Deleted]

        S Offline
        S Offline
        SeMartens
        wrote on last edited by
        #3

        Hi, as the error message is saying it, the FileInfo cannot be serialized/deserialized because the deserialization needs a constructor without parameters. So what you could do is to build your own FileInfo/DirectoryInfo class. Also you could try to customize the deserialization process, but i'm not sure if this is possible. Regards Sebastian

        It's not a bug, it's a feature! Me in Softwareland.

        M 1 Reply Last reply
        0
        • S SeMartens

          Hi, as the error message is saying it, the FileInfo cannot be serialized/deserialized because the deserialization needs a constructor without parameters. So what you could do is to build your own FileInfo/DirectoryInfo class. Also you could try to customize the deserialization process, but i'm not sure if this is possible. Regards Sebastian

          It's not a bug, it's a feature! Me in Softwareland.

          M Offline
          M Offline
          Muruvet Kaplan
          wrote on last edited by
          #4

          http://www.dalepreston.com/Blog/2005/02/returning-custom-classes-from-web.html[^] I want todo returning FileInfo type because i tried to file reading from server, but these files are encrypted and needed to be open from special project then read. the files are in server and size is out of 1 GB. my question is about a method to be able to read file from service and returning to the project... Thanks for replies.

          mkn

          S 1 Reply Last reply
          0
          • M Muruvet Kaplan

            http://www.dalepreston.com/Blog/2005/02/returning-custom-classes-from-web.html[^] I want todo returning FileInfo type because i tried to file reading from server, but these files are encrypted and needed to be open from special project then read. the files are in server and size is out of 1 GB. my question is about a method to be able to read file from service and returning to the project... Thanks for replies.

            mkn

            S Offline
            S Offline
            SeMartens
            wrote on last edited by
            #5

            If you need infos about the file from the server, you have to create your own FileInfo-class containing the properties you need. public class MyFileInfoClass { public Name { get; set; } public FullName {get; set; } } Just create this object before you return the result of your method and fill the properties using the FileInfo on your server. Btw. if you want to read the content of the file you have to transfer the file and not the FileInfo. Regards Sebastian

            It's not a bug, it's a feature! Me in Softwareland.

            1 Reply Last reply
            0
            • M Muruvet Kaplan

              [Message Deleted]

              M Offline
              M Offline
              Muruvet Kaplan
              wrote on last edited by
              #6

              the way you suggest, didn't solve my problem, if possible, please give me another solution i defined the class MyFileInfo and as member used FileInfo member to get the variable type but same error occured FileInfo in MyFileInfo cannot be serialized :confused:

              mkn

              S 1 Reply Last reply
              0
              • M Muruvet Kaplan

                the way you suggest, didn't solve my problem, if possible, please give me another solution i defined the class MyFileInfo and as member used FileInfo member to get the variable type but same error occured FileInfo in MyFileInfo cannot be serialized :confused:

                mkn

                S Offline
                S Offline
                SeMartens
                wrote on last edited by
                #7

                You can not use FileInfo in your result because it is not deserializable. What I suggested was that you create your class containing some properties of FileInfo you want to transport through the wire. But pls do not use the FileInfo-Type within the result, it will not work.

                It's not a bug, it's a feature! Me in Softwareland.

                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