Note that there are some explanatory texts on larger screens.

plurals
  1. POThe server did not provide a meaningful reply, can't find the issue within the class
    text
    copied!<p>I am getting a <code>CommunicationException</code> when trying to do a callback to a client, I know that the problem lies within this class, although I can't figure out what member is having trouble being serialized.</p> <pre><code>[DataContract] public sealed class DirectoryInformation : FileSystemInfo { public override void Delete() { Directory.Delete(FullName); } [DataMember] public override string Name { get { return Path.GetFileName(FullName); } } [DataMember] public override bool Exists { get { return Directory.Exists(FullName); } } [DataMember] public int Size { get; private set; } #region Ctor public DirectoryInformation(string directory) { FullPath = directory; Refresh(); CalculateDirectorySize(directory); } public DirectoryInformation() { } #endregion #region Private Methods private void CalculateDirectorySize(string directory) { if (!IsDirectoryAccessible(directory)) return; Size = Size + (int) Directory.GetFiles(directory).Select(x =&gt; new FileInfo(x)).Sum(x =&gt; x.Length); foreach (var dir in Directory.GetDirectories(directory)) CalculateDirectorySize(dir); } private static bool IsDirectoryAccessible(string directory) { try { Directory.GetFiles(directory); return true; } catch (UnauthorizedAccessException) { return false; } } #endregion } </code></pre> <p>I have already checked and it is not one of the members of <code>FileSystemInfo</code>, since the problem persisted even when removing the inheritance. I already made sure I am assigning all the members with <code>DataMember</code> attribute and there is a standard contructor.</p> <p>I think what is causing the problem is something I am not aware of the existence, but what could it be?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload