Build.cs target.cs documentation reference

Hi all. This is a question that I suppose everybody that starts with this will be questioning themselves.

  • What language is build.cs written in, so that we can search for documentation? (is it c#?)
  • When I move code that works on the “target.cs” file, to a plugin “build.cs” file, many variables stop working. Why?

While both files are .cs files and include barely nothing else, why do they use different variables, and what do we search for to get help?

Examples:

  • Console.Log to print now should be something like Log.TraceInformation. This works. Why? . I searched Console.WriteLine and it’s a C# function, but it doesn’t work here.
  • Path.GetFullPath, Path.Combine… to get paths… now doesn’t work. Path doesn’t exist. I read DirectoryReference.GetCurrentDirectory() should be used to get the current path, for example. But it doesn’t work either.

Found one of the answers: https://docs.unrealengine.com/latest/INT/Programming/UnrealBuildSystem/ModuleFiles/

build.cs is written in C# as I was expecting. But I still don’t get why I can’t use stuff that I was using in the Target.cs file.

I found another answer while learning in case somebody is interested:

To find documentation, search here:

Seems like the difference was that I need to include System for Path and System.IO to use Console. To do this in C# add:

using System

using System.IO

A new question arises: Which version of c# is Unreal Engine 4.18 using?