docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Method LogDocCompileWarningsAndErrors

    LogDocCompileWarningsAndErrors(PackageInfo, string)

    Recompiles assemblies in a package with the -doc compiler option, which convinces the compiler to report warnings and errors related to the documentation comments.

    Declaration
    public static void LogDocCompileWarningsAndErrors(PackageInfo packageInfo, string baseOutputDir)
    Parameters
    Type Name Description
    PackageInfo packageInfo

    The info object describing the package.

    string baseOutputDir

    Where to compile the assembly and companion XML files.

    Remarks

    The function attempts to compile things as close as possible to the way an assembly is compiled by Unity. However, it isn't currently perfect and can report compile errors that aren't encountered during the normal compilation process.

    The feature also allows you to cet the C# language version compiler option. This should normally be left as the defualt value, "latestMajor", but you can set it to a lower value to identify code in a package that uses the most recent language features. In turn, this lets you verify that the generated docs for such code is correct and reasonable. DocFX only recently added support for C# 9, for example, which might not be complete.

    Note

    The Package Manager UI button to run this function has been removed, but the function still exists and can be run from custom Unity Editor code. The AssemblyBuilder class on which this utility is built is being removed from Unity. Future versions of the PMDT might provide a similar feature, albeit with a very different implementation.

    In This Article
    Back to top
    Copyright © 2025 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)