gpt4 book ai didi

c# - 解决构建错误 CS0579 重复 'System.Reflection.Assemblyxxxx' 属性

转载 作者:行者123 更新时间:2023-12-04 14:00:17 28 4
gpt4 key购买 nike

在使用 xunit 进行测试时,我在运行测试(CS0579 和 CS0006)时不断遇到构建错误:

Build Errors generated by Visual Studio when executing tests.

我尝试删除 bin/obj 文件夹并尝试使用 false 抑制属性的生成,但两者都导致了其他问题(来源:https://github.com/dotnet/cli/issues/4710)。

溶液结构:

Project structure

我不得不手动添加对 xunit.core.dll 和 xunit.assert.dll 的引用。

有没有人有解决这个问题的经验?我还在测试抛出异常的方法时遇到问题(请参阅 Exception not being thrown in setter ),我怀疑这可能是根本原因的症状。

最佳答案

这是解决您的问题的方法(我昨天遇到并今天解决了):
https://stackoverflow.com/a/62426421/4734707

关于c# - 解决构建错误 CS0579 重复 'System.Reflection.Assemblyxxxx' 属性,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49223501/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com