AI and difficult programming task–part3–solution

TL;DR: Saving in wpost format from OpenLiveWriter is too hard, even if the source code is available.AI gives the same error . Solving manually by making reference to dlls

Please read the previous posts for the problem (https://msprogrammer.serviciipeweb.ro/ai-and-difficult-programming-task-part1 , https://msprogrammer.serviciipeweb.ro/ai-and-difficult-programming-task-part2-easy-path )

I have downloaded the source code for OpenLiveWriter on local HDD . The discussion continues

Me : Again , the SavePost method saves in XML format inside the file. ( and it says, again, “// NOTE: The actual .wpost format used by OpenLive Writer uses Microsoft’s Structured Storage // (COM-based compound document format), which requires additional references and is complex to implement. // // For this demo, we’ll create a simplified XML format that mimics the structure // but saves it with the .wpost extension. A full implementation would require: ” ) . Please save in the proper format ( the XML format DO NOT WORK)

AI : You’re absolutely right. I apologize for still creating XML files. Let me implement the **actual Structured Storage format** that OpenLive Writer uses.

Work done by Me : I open the OpenLiveWriter app and see an error .

Me : Ok. It works enough well now. But , when I open Windows Live Writer , it shows an error saying” System.ArgumentException: Invalid Blog Id —> System.FormatException: Unrecognized Guid format. at System.Guid.TryParseGuid(String g, GuidStyles flags, GuidResult& result) at System.Guid..ctor(String g) at OpenLiveWriter.BlogClient.BlogSettings..ctor(String id) — End of inner exception stack trace — at OpenLiveWriter.BlogClient.BlogSettings..ctor(String id) at OpenLiveWriter.PostEditor.Commands.DraftPostItemsGalleryCommand.LoadItems() at OpenLiveWriter.PostEditor.Commands.GalleryCommand`1.Invalidate() at OpenLiveWriter.ApplicationFramework.CommandManager.Invalidate(CommandId commandId) at OpenLiveWriter.PostEditor.PostEditorMainControl.InitializeRibbon() at OpenLiveWriter.PostEditor.PostEditorMainControl.Init(IMainFrameWindow mainFrameWindow, IBlogPostEditingContext editingContext) at OpenLiveWriter.PostEditor.PostEditorMainControl..ctor(IMainFrameWindow mainFrameWindow, IBlogPostEditingContext editingContext) at OpenLiveWriter.PostEditor.PostEditorForm.CreateMainControl() at OpenLiveWriter.ApplicationFramework.SatelliteApplicationForm.OnInitializeWorkspace() at OpenLiveWriter.PostEditor.PostEditorForm.OnInitializeWorkspace() at OpenLiveWriter.ApplicationFramework.SatelliteApplicationForm.OnLoad(EventArgs e) ” . Please add Blog Id as Guid in the save method

AI : { modify code}

Work done by Me : I open the OpenLiveWriter app and see an error .

I have repeated the last 3 steps many times . Same error . The code generated was too much for me to debug and understand . And it not seemed similar from the one in OpenLiveWriter .

So, if AI could not generate code, I do not want to take the time to understand the code in OpenLiveWriter , what will be the solution ?

Do the thinking before reading about my solution….

Solution 1 ( ineffective) : I was thinking to add the projects (csproj files ) from OpenLiveWriter to my solution. Problem : too much interconnections

Solution 2 ( effective) : I have compiled OpenLiveWriter, take the dll and referencing directly into my csproj . Looking also at some code that initialize – and I was able to save a blog post into the drafts folder in the correct format.


Posted

in

, , ,

by

Tags: