You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何解决Runtime.OpenSilver.csproj中CS0579重复属性编译错误?

解决CS0579重复AssemblyVersionAttribute属性错误

在部分配置环境下,编译器会报出以下错误:

error CS0579: Duplicate 'System.Reflection.AssemblyVersionAttribute' attribute [path\OpenSilverFramework\src\Runtime\Runtime\Runtime.OpenSilver.csproj]

这类重复属性问题的出现可能因系统环境差异而不同,针对.NET与.NET Core混合的方案,可通过修改Runtime.OpenSilver.csproj文件解决:在项目文件中添加如下配置节点,禁用自动生成的程序集信息和目标框架属性:

<PropertyGroup>
  <GenerateTargetFrameworkAttribute>false</GenerateTargetFrameworkAttribute>
  <GenerateAssemblyInfo>false</GenerateAssemblyInfo>
</PropertyGroup>

内容的提问来源于stack exchange,提问作者ugiacobbi

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.13 19:38:10