解决方案:错误CS0579“System.Reflection.AssemblyCompanyAttribute”特性重复


使用VS2022创建一个DLL类库编译出错:

严重性 代码 说明 项目 文件 禁止显示状态

错误 CS0579 “System.Reflection.AssemblyCompanyAttribute”特性重复 CartonERP.LicenseCore F:\Jonnys_Source\CartonERP\LicenseCore\Source\debug\Debug\net6.0\CartonERP.LicenseCore.AssemblyInfo.cs 14 活动

错误	CS0579	“System.Reflection.AssemblyCompanyAttribute”特性重复

原因

AssemblyInfo.cs文件由 MSBuild WriteCodeFragment 类生成。

解决方案

打开csproj文件,添加 <GenerateAssemblyInfo>false</GenerateAssemblyInfo>

项目csproj文件参考

HTML 全选
<Project Sdk="Microsoft.NET.Sdk">

	<PropertyGroup>
		<TargetFramework>net6.0</TargetFramework>
		<ImplicitUsings>enable</ImplicitUsings>
		<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
		<Nullable>enable</Nullable>
		<OutputType>Library</OutputType>
		<BaseOutputPath>..\debug</BaseOutputPath>
		<BaseIntermediateOutputPath>..\debug</BaseIntermediateOutputPath>
	</PropertyGroup>

</Project>

 

DLL类库 AssemblyInfo.cs文件

 

C# 全选
using System.Reflection;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following 
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("CartonERP.LicenseCore")]
[assembly: AssemblyDescription("C/S框架网(www.csframework.com)")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("C/S框架网(www.csframework.com)")]
[assembly: AssemblyProduct("CSFramework.Common")]
[assembly: AssemblyCopyright("版权所有 C/S框架网(www.csframework.com) 2010~2023")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible 
// to COM components.  If you need to access a type in this assembly from 
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("c6c741d7-58d1-4517-937c-39fe60d83817")]

// Version information for an assembly consists of the following four values:
//
//      Major Version
//      Minor Version 
//      Build Number
//      Revision
//
// You can specify all the values or you can default the Revision and Build Numbers 
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]

 

 

版权声明:本文为开发框架文库发布内容,转载请附上原文出处连接
C/S框架网
上一篇:错误 NU1301 无法加载源 https://api.nuget.org/v3/index.json 的服务索引(解决方案)
下一篇:SQL Server Management Studio 评估期已过解决办法
评论列表

发表评论

评论内容
昵称:
关联文章

解决方案错误CS0579System.Reflection.AssemblyCompanyAttribute特性重复
WCF:(400) Bad Request 错误解决方案
VS编译错误:已导入一个具有相同标识"System.Net.Http,Version=2.2.29"的程序集。请尝试移除其中一个重复的引用。
多语言界面软件开发框架 - 初始化多语言时发生单引号错误解决方案
ASP.NET WebApi缺少System.Web.Http.Cors引用解决方案
打开VS解决方案出现 Unknown Hard Error 错误
创建SoapClient对象几个常见错误提示及解决方案
CS框架局域网版本自动升级解决方案》.doc
WebApi日期解析错误:The JSON value could not be converted to System.Nullable`1[System.DateTime].
.NET5 HttpClient多线程并发请求阻塞“发生一个或多个错误解决方案
WCF服务错误System.TimeoutException: 请求通道在等待 00:01:00 以后答复时超时
重复的组件名称"pnlContainer"。组件名称必须唯一且不区分大小写。
错误 NU1301 无法加载源 https://api.nuget.org/v3/index.json 的服务索引(解决方案
解决方案:未能添加SSL证书,错误:1312,指定的登录会话不存在。可能已被终止
解决方案:C# 当按钮不可见时(Visible=False),调用Button.PerformClick事件无效!
GridControl继承解决方案
解决方案:WCF客户端无法获取服务端抛出的异常详细信息
C#.NET SQL数据库备份与还原解决方案
生成的项目模块(Project)添加到VS解决方案 - C/S框架三层架构代码生成器操作指南
C#源代码安全缺陷与提高源代码质量解决方案

热门标签
.NET5 .NET6 .NET7 APP Auth-软件授权注册系统 Axios B/S B/S开发框架 Bug Bug记录 C#加密解密 C#源码 C/S CHATGPT CMS系统 CodeGenerator CSFramework.DB CSFramework.EF CSFrameworkV1学习版 CSFrameworkV2标准版 CSFrameworkV3高级版 CSFrameworkV4企业版 CSFrameworkV5旗舰版 CSFrameworkV6.0 DAL数据访问层 Database datalock DbFramework Demo教学 Demo下载 DevExpress教程 DOM EF框架 Element-UI EntityFramework ERP ES6 Excel FastReport GIT HR IDatabase IIS JavaScript LINQ MES MiniFramework MIS NavBarControl Node.JS NPM OMS ORM PaaS POS Promise API Redis SAP SEO SQL SQLConnector TMS系统 Token令牌 VS2022 VSCode VUE WCF WebApi WebApi NETCore WebApi框架 WEB开发框架 Windows服务 Winform 开发框架 Winform 开发平台 WinFramework Workflow工作流 Workflow流程引擎 版本区别 报表 踩坑日记 操作手册 代码生成器 迭代开发记录 基础资料窗体 架构设计 角色权限 开发sce 开发技巧 开发教程 开发框架 开发平台 开发指南 客户案例 快速搭站系统 快速开发平台 秘钥 密钥 权限设计 软件报价 软件测试报告 软件简介 软件开发框架 软件开发平台 软件开发文档 软件体系架构 软件下载 软著证书 三层架构 设计模式 生成代码 实用小技巧 收钱音箱 数据锁 数据同步 微信小程序 未解决问题 文档下载 喜鹊ERP 喜鹊软件 系统对接 详细设计说明书 行政区域数据库 需求分析 疑难杂症 蝇量级框架 蝇量框架 用户管理 用户开发手册 用户控件 在线支付 纸箱ERP 智能语音收款机 自定义窗体 自定义组件 自动升级程序