'Missing assembly reference to implement an `IPreprocessBuildWithReport`?
All I want is to implement a simple IPreprocessBuildWithReport to write a .csv file...
using System.IO;
using System.Text;
using UnityEditor;
using UnityEditor.Build;
using UnityEditor.Build.Reporting;
using UnityEditor.Callbacks;
namespace My.App.Scripts
{
public class MyStuffDoer : IPreprocessBuildWithReport
public int callbackOrder => 0;
public void OnPreprocessBuild(BuildReport report)
{
DoMyStuff();
}
[DidReloadScripts]
public static void DoMyStuff()
{
...
}
}
}
Rider is happy to accommodate me, but Unity is refusing to build, insisting that
The type or namespace 'Build' does not exist in the namespace 'UnityEditor' (are you missing an assembly reference?)
The type or namespace 'Callbacks' does not exist in the namespace 'UnityEditor' (are you missing an assembly reference?)
The type or namespace 'IPreprocessBuildWithReport' could not be found (are you missing a using directive or an assembly reference?)
The type or namespace 'BuildReport' could not be found (are you missing a using directive or an assembly reference?)
The type or namespace 'DidReloadScriptsAttribute' could not be found (are you missing a using directive or an assembly reference?)
The type or namespace 'DidReloadScripts' could not be found (are you missing a using directive or an assembly reference?)
Stop asking me, Unity, I don't know! AM I?!
Can't seem to find anything remotely useful on the internet in regards to this.
And all the examples I find just toss their IPreprocessBuildWithReport implementation at me, with absolutely no mention of an assembly.
How do you implement an IPreprocessBuildWithReport?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
