Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't resolve reference graphs with circular references. #56

Open
ghost opened this issue Jul 21, 2016 · 4 comments
Open

Can't resolve reference graphs with circular references. #56

ghost opened this issue Jul 21, 2016 · 4 comments
Assignees

Comments

@ghost
Copy link

ghost commented Jul 21, 2016

Consder the following types:

class Parent
{
     public List<Child> Children { get; set; }
}

class Child
{
    public Parent Parent { get; set; }
}

Whenever trying to calculate depth in such cases, and whenever trying to export such objects. The plugin works very long and then crashes along with Visual Studio.

@OmarElabd
Copy link
Owner

The depth solver has two options for stopping the depth calculation, one is level (default 25) and the other is timeout (20,000 ms). Can you double check these settings? You can also try adjusting them (Maybe a cutoff of 5 instead of 25).

image

I'll try and see if I can't replicate the issue.

@OmarElabd OmarElabd self-assigned this Jul 21, 2016
@ghost
Copy link
Author

ghost commented Jul 22, 2016

Hi OmarElabd,

I noticed those settings. When I specify a Maximum Depth Cutoff - let's say, with 3, the object exporter dialog successfully calculates "depths" for my objects and gives me ">3" as a result. But when Exporting, the plugin still runs indefinitely and crashes.

I know this is very specific to the data that I have in my application. And your plugin is really useful, it's just that you guys need to handle such corner cases in your serializing/depth calculation code.

@mikejr83
Copy link

Is it possible to perhaps have another type of export, NewtonsoftJson? It has the ability to generate JSON which when serialized will provide the information necessary to deserialize the object graph with the circular references.

@OmarElabd
Copy link
Owner

Hi @mikejr83, it is possible to resolve circular references in C#, JSON and XML. See #33 for more details. This would require a big change to how the objects are currently serialized, but it's definitely on the horizon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants