tfsbuildextensions / BuildManager

Community TFS Build Manager
54 stars 27 forks source link

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

Open alustrement opened 9 years ago

alustrement commented 9 years ago

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 commented 9 years ago

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

alustrement commented 9 years ago

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 commented 9 years ago

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