admin管理员组文章数量:1278948
These commands fail with the errors:
dotnet new webapi
dotnet new classlib -o Lib
dotnet add reference Lib/Lib.csproj
dotnet build (SUCCESS)
dotnet build (ERRORS)
test failed with 8 error(s) (0,3s)
C:\prj\test\obj\Debug\net9.0\.NETCoreApp,Version=v9.0.AssemblyAttributes.cs(4,12): error CS0579: Duplicate 'global::System.Runtime.Versioning.TargetFrameworkAttribute' attribute
C:\prj\test\obj\Debug\net9.0\test.AssemblyInfo.cs(13,12): error CS0579: Duplicate 'System.Reflection.AssemblyCompanyAttribute' attribute
C:\prj\test\obj\Debug\net9.0\test.AssemblyInfo.cs(14,12): error CS0579: Duplicate 'System.Reflection.AssemblyConfigurationAttribute' attribute
C:\prj\test\obj\Debug\net9.0\test.AssemblyInfo.cs(15,12): error CS0579: Duplicate 'System.Reflection.AssemblyFileVersionAttribute' attribute
C:\prj\test\obj\Debug\net9.0\test.AssemblyInfo.cs(16,12): error CS0579: Duplicate 'System.Reflection.AssemblyInformationalVersionAttribute' attribute
C:\prj\test\obj\Debug\net9.0\test.AssemblyInfo.cs(17,12): error CS0579: Duplicate 'System.Reflection.AssemblyProductAttribute' attribute
C:\prj\test\obj\Debug\net9.0\test.AssemblyInfo.cs(18,12): error CS0579: Duplicate 'System.Reflection.AssemblyTitleAttribute' attribute
C:\prj\test\obj\Debug\net9.0\test.AssemblyInfo.cs(19,12): error CS0579: Duplicate 'System.Reflection.AssemblyVersionAttribute' attribute
The first dotnet build
succeeds, any subsequent dotnet build
(even with clean/restore
) fail.
If I place the webapi in a folder on its own, it works:
dotnet new webapi -o Api
dotnet new classlib -o Lib
cd Api
dotnet add reference ../Lib/Lib.csproj
dotnet build (SUCCESS)
dotnet build (SUCCESS)
I am using the latest 9.0 SDK
Deleting the Lib/obj, Lib/bin
resolves this (once).
What am I missing here?
本文标签: netdotnet build assembly error in nested projectsStack Overflow
版权声明:本文标题:.net - dotnet build assembly error in nested projects - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741267077a2368678.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论