How can I treat MSB3245 (could not resolve reference) warning as an error?

前端 未结 2 1421
执念已碎
执念已碎 2020-11-27 07:56

My question is based on another one, but I want to do the opposite: tell msbuild to treat the warning as an error instead of suppressing a specific msbuild warning.

2条回答
  •  遥遥无期
    2020-11-27 08:57

    It seems that the message associated with this warning that's not a warning:

    If this reference is required by your code, you may get compilation errors

    , is not quite correct. If the missing reference is a WPF theme, you'll get a run-time error (System.IO.FileNotFoundException) instead.

    As an aside, if you specifically look for MSB3245 you'll get:

    CSC : warning CS1691: 'MSB3245' is not a valid warning number

提交回复
热议问题