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

Json.net : Self referencing loop detected with 2010 template export #16

Open
alustrement opened this issue Apr 28, 2015 · 3 comments
Open

Comments

@alustrement
Copy link

This bug was report on the Visual Studio Gallery page : https://visualstudiogallery.msdn.microsoft.com/73bf2d8e-aec6-406c-8e7f-1c678e46557f/view/Discussions/0
Correct it by change the end of "ExportDefinition" method of "BuildManagerViewModel" class with :

        var jsonSerializerSettings = new JsonSerializerSettings
        {
            PreserveReferencesHandling = PreserveReferencesHandling.Objects,
            ReferenceLoopHandling = ReferenceLoopHandling.Serialize
        };
        File.WriteAllText(Path.Combine(filePath, b.Name + ".json"), JsonConvert.SerializeObject(buildToExport, Formatting.Indented, jsonSerializerSettings));
@mikefourie-zz
Copy link
Collaborator

Available to try in 1.0.47 appveyor build - https://ci.appveyor.com/project/tfsbuildextensions/buildmanager/build/artifacts

@alustrement
Copy link
Author

Erf, there is a problem with import now, circurlar references are resolved by adding "$id" and "$ref" properties in json. This not works on import. In my case it doesn't matter because I need only the export and have a treatment next. I will try to figure it out soon.

@mikefourie-zz
Copy link
Collaborator

Hmmm, the one import test I did worked... I guess I didnt hit issue on export...

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