【问题标题】:Unity3D Project Configuration: Treat warnings as errorsUnity3D 项目配置:将警告视为错误
【发布时间】:2019-02-27 17:30:16
【问题描述】:

我正在尝试从 Unity 编辑器中配置我的项目,以将所有警告消息视为错误,但我似乎找不到任何与此相关的文档。有没有办法可以为我的项目配置它?非常感谢!

【问题讨论】:

    标签: c# unity3d compiler-errors compiler-warnings


    【解决方案1】:

    在ProjectFolder/Assets/smcs.rsp中创建一个文本文件

    该文件中的所有内容都将作为编译器命令行参数结束

    强制警告为错误的参数是-warnaserror+,所以将它添加到smcs.rsp

    如果您对其他可用参数感兴趣,请运行UnityInstallFolder/editor/data/bin/smcs /?

    更多关于https://answers.unity.com/questions/216838/how-to-force-warnings-as-errors.html

    【讨论】:

    • 没什么特别的;)
    • 另外,根据:docs.unity3d.com/Manual/PlatformDependentCompilation.htmlNote that the .rsp file needs to match the compiler being invoked. For example: when targeting the .NET 3.5 Equivalent (deprecated) scripting runtime version, mcs is used with mcs.rsp, and when targeting the .NET 4.x Equivalent scripting runtime version compiler, csc is used with csc.rsp.
    猜你喜欢
    • 2011-01-05
    • 2012-01-13
    • 2022-08-03
    • 2010-11-05
    • 2013-07-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多