Missing function on AssetDatabase, only when building on build-server in batch-mode

Hello!
I just was extending one of our editor-scripts by automatically saving changes made on some ScriptableObjects done by the tool.
For that I made use of:

EditorUtility.SetDirty(modifiedScriptableObject);
AssetDatabase.SaveAssetIfDirty(modifiedScriptableObject);

This works totally fine and I can make builds in the local editor just fine.
When I check this into our vcs system, our build-server (jetbrains-teamcity) will pull the project, and runs our build-scripts with the same editor-version in batchmode.
Step one is:

  • Opening the project in batchmode and execute a static function to change the build-target, scripting define symbols etc.
    Step two is:
  • Opening the project again via commandline in batchmode to actually build the application. (necessary because of this mentioned in adressables docs)

Rinse and Repeat for every target-platform (windows/mac/…)

Now since we made use of the above mentioned function on AssetDatabase, the build fails in Step 1 for the first Platform (Windows - ReleaseBuild)
With the Compile-Time-Error:
error CS0117: ‘AssetDatabase’ does not contain a definition for ‘SaveAssetIfDirty’ (new); scripts have compiler errors.; exit code 1

Does anyone here has an Idea as of what could happen there? The Script is inside of an Editor-Only Assembly so this is not an issue of some missing #if UNITY_EDITOR (also tried wrapping it additionally), and the script shouldn’t even matter on that platform. Seems like an issue with the assembly being compiled falsely by the compiler:
8152031--1059047--upload_2022-5-24_12-16-8.png

How can this one method go missing, but anything else in the script (also uses AssetDatabase and EditorUtility Functions) is there? If I comment out the line using the function the build works fine (of course the autosave feature doesn’t work then).

We’re on Unity Version 2021.1.28f1 if that matters.

A colleague of mine found the following change in one of Unity’s own repositories:
https://github.com/Unity-Technologies/2d-extras/commit/b41b6d291a9968297948355814327cc2cd98dd47

Does this mean, this is an issue with Unity Version 2021.1+? Will this function be deprecated and is missing an Obsolete-Attribute?
I really don’t want to save all assets marked dirty automatically, only the ones explicitly modified by our tool. Can someone clarify?

Update, resolved:
Our Build-Server’s Unity install wasn’t updated, when the Team moved from 2021.1.9f1 to 2021.1.28f1. The function was introduced in 2021.1.17f according to the friendly Unity-Dev getting back on my comment in Github.
My bad not checking that, thread can be closed :sweat_smile: