How to step through cooking process on debug Mode?

It is more about curiosity.
I am trying to understand what is happening during cooking process.
So my 1st step was to press:
File->“cook contents for windows”

Then I stepped through the process using breakpoints and found out this specific function :

void FMainFrameActionCallbacks::CookContent(const FName InPlatformInfoName)

but the problem is after a few steps it always fails.
Because Cooking never works on debugging mode.
It always fails with this error:

MainFrameActions: Cooking (Windows):
Running AutomationTool…
MainFrameActions: Cooking (Windows):
CSC : error CS2012: Cannot open
‘J:\4.11.2_cpp\Engine\Source\Programs\AutomationTool\AutomationUtils\obj\Development\AutomationUtils.Automation.dll’
for writing – ‘The process cannot
access the file
‘J:\4.11.2_cpp\Engine\Source\Programs\AutomationTool\Aut
MainFrameActions: Cooking (Windows):
omationUtils\obj\Development\AutomationUtils.Automation.dll’
because it is being used by another
process.’
[J:\4.11.2_cpp\Engine\Source\Programs\AutomationTool\AutomationUtils\AutomationUtils.Automation.csproj]
MainFrameActions: Cooking (Windows):
RunUAT.bat ERROR: AutomationTool
failed to compile. MainFrameActions:
Cooking (Windows): BUILD FAILED

So how to make cooking work on Debug mode , so that i can step through the process using visual studio?

Hi, have you manged to debug cooking by now?

Thanks, I will give that a try!

@haimat, yup. i was able to .

look into “Engine\Source\Editor\UnrealEd\Classes\Commandlets\CookCommandlet.h”

put a breakpoint inside “NewCook(const TArray& Platforms, TArray& FilesInPath)”.

then type proper commandlet lunch command in your command prompt.
for me it was:
J:\4.11_Cpp\Engine\Binaries\Win64\UE4Editor.exe J:\UnrealProjects\pak_4_11_p2\pak_4_11_p1.uproject -run=myCommandlet3Commandlet

or

J:\4.11_Cpp\Engine\Binaries\Win64\UE4Editor.exe J:\UnrealProjects\pak_4_11_p2\pak_4_11_p1.uproject -run=myCookCommandlet -COOKDIR=“J:\UnrealProjects\pak_4_11_p2\Content\obj_uassets”

comment here if u fail to work it out