# Debugging Build.cs scripts 

**URL:** <https://forums.unrealengine.com/t/debugging-build-cs-scripts/2655608>\
**Category:** Pipeline & Plugins\
**Tags:** Epic-Pro-Support, unreal-engine, question\
**Created:** [August 5, 2025, 7:55pm UTC](https://forums.unrealengine.com/t/debugging-build-cs-scripts/2655608 "2025-08-05T19:55:07Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous-edc](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous-edc](https://forums.unrealengine.com/u/anonymous-edc)\
**Post date:** [August 5, 2025, 7:55pm UTC](https://forums.unrealengine.com/t/debugging-build-cs-scripts/2655608/1 "2025-08-05T19:55:07Z")

</div>

Hello,

I’d like to debug some of my build scripts to better understand what happens. Since it’s code, I expect to be able to put a breakpoint and step through the execution.

I couldn’t figure out how to do it. Do you have any guidance?

Thanks !

---

<div class="post-metadata">

**Author:** ![Patrick\_Laflamme](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/patrick_laflamme/32/1225277_2.png) [@Patrick\_Laflamme](https://forums.unrealengine.com/u/Patrick_Laflamme)\
**Post date:** [August 5, 2025, 9:16pm UTC](https://forums.unrealengine.com/t/debugging-build-cs-scripts/2655608/2 "2025-08-05T21:16:28Z")

</div>

Hi,

To debug UBT (your Build.cs) file, you would:

- In VS, set _ **UnrealBuildTool** _ program as your default program.
- In VS, set the ‘Debug’ and ‘Win64’ target
- In VS, right-click on _UnrealBuildTool_ project -\> Build
- In VS, right-click on the _UnrealBuildTool_ project -\> Properties -\> Debug -\> Open debug launch profiles UI
  - Enter the UBT command line arguments. (You can find them in the logs when you build) Ex: _ **-Target=“LyraEditor Win64 Development -Project=D:\UE\_5.6\Samples\Games\Lyra\Lyra.uproject”** _

- Edit/touch the _build.cs_ you want to debug. I believe UBT caches some outputs to avoid re-running everything. By touching the file (add a space/save), it forces UBT to run the code again and hit your breakpoints.
- Start UnrealBuildTool in debug (F5).

In my case, I also had to go _VS -\> Tools -\> Options… -\> Debugging -\> General_ and uncheck ‘Require source files to exactly match the original version’ to hit the breakpoint for my project.

[Image Removed]

Let me know how it goes.

Regards,

Patrick

---

<div class="post-metadata">

**Author:** ![anonymous-edc](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous-edc](https://forums.unrealengine.com/u/anonymous-edc)\
**Post date:** [August 6, 2025, 2:16am UTC](https://forums.unrealengine.com/t/debugging-build-cs-scripts/2655608/3 "2025-08-06T02:16:27Z")

</div>

Thanks a lot Patrick, I was able to debug a Build.cs script thanks to your instructions.

My particular issue was that I am using Rider with the EzArgs plugin which tries to replicate the UnrealVS UI for passing arguments to the program, but I discovered that it only works for C++ programs. Still your answer was very useful in confirming how I should proceed.

---

<div class="post-metadata">

**Author:** ![Patrick\_Laflamme](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/patrick_laflamme/32/1225277_2.png) [@Patrick\_Laflamme](https://forums.unrealengine.com/u/Patrick_Laflamme)\
**Post date:** [August 6, 2025, 1:31pm UTC](https://forums.unrealengine.com/t/debugging-build-cs-scripts/2655608/4 "2025-08-06T13:31:21Z")

</div>

Hi,

I’m glad you were able to figure this out. By the way, you can also add logs to the .cs file, UBT will recompile automatically. I often do that for small quick checks because it’s usually faster than debugging. Something like:

`System.Console.WriteLine("==================== Log Something =======================");`Regards,

Patrick

---

<div class="post-metadata">

**Author:** ![anonymous-edc](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous-edc](https://forums.unrealengine.com/u/anonymous-edc)\
**Post date:** [August 6, 2025, 2:10pm UTC](https://forums.unrealengine.com/t/debugging-build-cs-scripts/2655608/5 "2025-08-06T14:10:05Z")

</div>

Thanks for the suggestion ! This is great

---

<div class="post-metadata">

**Author:** ![anonymous-edc](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous-edc](https://forums.unrealengine.com/u/anonymous-edc)\
**Post date:** [August 12, 2025, 1:55pm UTC](https://forums.unrealengine.com/t/debugging-build-cs-scripts/2655608/6 "2025-08-12T13:55:29Z")

</div>

As a side note, I’ve had issues with breakpoints not setting in those .cs files because of inconsistent line endings, and the way UBT reads the files to dynamically compile them.

The fix is to use ReadAllBytesAsync instead of ReadAllTextAsync in ParseSyntaxTreeAsync:

[Image Removed]

Cheers,

Lambert

---

<div class="post-metadata">

**Author:** ![Patrick\_Laflamme](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/patrick_laflamme/32/1225277_2.png) [@Patrick\_Laflamme](https://forums.unrealengine.com/u/Patrick_Laflamme)\
**Post date:** [August 12, 2025, 2:27pm UTC](https://forums.unrealengine.com/t/debugging-build-cs-scripts/2655608/7 "2025-08-12T14:27:30Z")

</div>

Thanks Clara, I shared the info to UBT developer.

Regards,

Patrick

---

<div class="post-metadata">

**Author:** ![Patrick\_Laflamme](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/patrick_laflamme/32/1225277_2.png) [@Patrick\_Laflamme](https://forums.unrealengine.com/u/Patrick_Laflamme)\
**Post date:** [August 12, 2025, 4:25pm UTC](https://forums.unrealengine.com/t/debugging-build-cs-scripts/2655608/8 "2025-08-12T16:25:27Z")

</div>

FYI: JIRA created (UE-313099). We are going to take a look at this issue with line ending and probably take your proposed fix.

---

<div class="post-metadata">

**Author:** ![GribUser](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@GribUser](https://forums.unrealengine.com/u/GribUser)\
**Post date:** [May 29, 2026, 2:09pm UTC](https://forums.unrealengine.com/t/debugging-build-cs-scripts/2655608/9 "2026-05-29T14:09:30Z")

</div>

Did not work for debugging plugin’s Build.cs for me. Like it runs the build OK in the console with the errors and all, but breakpoints do not work ☹
