【发布时间】:2019-02-27 17:30:16
【问题描述】:
我正在尝试从 Unity 编辑器中配置我的项目,以将所有警告消息视为错误,但我似乎找不到任何与此相关的文档。有没有办法可以为我的项目配置它?非常感谢!
【问题讨论】:
标签: c# unity3d compiler-errors compiler-warnings
我正在尝试从 Unity 编辑器中配置我的项目,以将所有警告消息视为错误,但我似乎找不到任何与此相关的文档。有没有办法可以为我的项目配置它?非常感谢!
【问题讨论】:
标签: c# unity3d compiler-errors compiler-warnings
在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
【讨论】:
Note 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.