【问题标题】:What does the 'GenerateBindingRedirectsOutputType' option do?“GenerateBindingRedirectsOutputType”选项有什么作用? 【发布时间】:2020-01-18 23:04:58 【问题描述】: 当在 csproj 文件中设置为“true”时,“GenerateBindingRedirectsOutputType”选项有什么作用? 【问题讨论】: 标签: .net msbuild csproj 【解决方案1】: 正如我们所看到的here,我们需要AutoGenerateBindingRedirects 和GenerateBindingRedirectsOutputType 标志来使“自动生成绑定重定向”的一些东西起作用。 GenerateBindingRedirectsOutputType 将设置为 true,以防您正在构建 exe 或 winexe,如 here 所写。 因此,如果您需要在构建库 dll 时生成绑定重定向,您需要手动指定 GenerateBindingRedirectsOutputType 标志。 【讨论】: 【解决方案2】: 生成 .exe 可执行文件的项目不需要它,但单元测试项目需要它。 【讨论】: