我正在开发一个通过运行dotnet new angular
(Clear blog explanation of usage)开始生活的Web应用程序。
为了扩展默认代码的功能,我开始开发Web API。我添加了3个新的.Net Core库项目,分别为Shared
,Scheduling
和Scheduling_Tests
。
在Scheduling
中定义了一些域模型类,在Shared
中定义了一些基类,最后在ShedulingTests
中定义了一些NUnit测试。
构建解决方案时,Web应用程序项目中将出现2个新文件夹:Shared
和Scheduling
。我还收到类似以下的生成错误:
Error CS0579 Duplicate 'System.Reflection.AssemblyCompanyAttribute'
我不确定该如何处理,任何建议都将受到欢迎。
最佳答案
发生这种情况是因为新的.NET工具会自动创建属性并将其添加到程序集中,因此它们现在在构建中出现两次。
有两种解决方法:
例如:
(感谢https://johnkoerner.com/csharp/dealing-with-duplicate-attribute-errors-in-net-core/)
关于visual-studio-2017 - VS 2017构建错误-AssemblyInfo.cs中的属性重复,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/45349981/