NonSerialized 属性忽略序列化报错'NonSerialized' is not valid on this declaration type
[XmlIgnore]
[NonSerialized]
public List<string> paramFiles { get; set; } //I get the following error: //Attribute 'NonSerialized' is not valid on this declaration type.
It is only valid on 'field' declarations.
[AttributeUsageAttribute(AttributeTargets.Field, Inherited = false)]
[ComVisibleAttribute(true)]
public sealed class NonSerializedAttribute : Attribute
I suggest using backing field
public List<string> paramFiles { get { return list;} set { list = value; } }
[NonSerialized]
private List<string> list;
参考:https://stackoverflow.com/questions/7693391/nonserialized-on-property
延伸:https://www.cnblogs.com/shy1766IT/p/5459707.html Json序列化指定输出字段 忽略属性
NonSerialized 属性忽略序列化报错'NonSerialized' is not valid on this declaration type的更多相关文章
- notification 报错the method build() is undefined for the type Notificatin.Builder
notification 报错the method build() is undefined for the type Notificatin.Builder 这事api版本号太低导致的 Notifi ...
- Eclipse怎么忽略掉报错的js文件
第一步,我们要先定位错误在哪里,选择菜单里window——show view——other,选择Problems. 第二步,点击有红叉的项目,在Problems视图中,可以看到是什么错,哪个文件夹中的 ...
- 对象逆序列化报错:java.lang.ClassNotFoundException
简单的想从保存的对象中又一次解析出对象.用了逆序列化,但是报错: java.lang.ClassNotFoundException: xxxxxxxxxxxx at java.net.URLClass ...
- MyEclipse忽略js报错
MyEclipse对官网下载的js报错,解决办法如下: 1. 对js文件右键选择 MyEclipse --> Exclude From Validation 2. 然后继续右键执行MyEclip ...
- ref 属性使用eslint报错
react 使用 ref 报错 ,[eslint] Using string literals in ref attributes is deprecated. (react/no-string-re ...
- angular中datetime-local属性使用ng-model报错
项目需求是将年月日格式更改为年月日时分的格式展示,翻遍了整个项目没找到符合的组件,自己现敲一个也来不及,只好直接使用原生自带的组件--datetime-local.之前都是用的vue写项目,第一次接触 ...
- 在angular项目中使用bootstrap的tooltip插件时,报错Property 'tooltip' does no t exist on type 'JQuery<HTMLElement>的解决方法和过程
在angular4的项目中需要使用bootstrap的tooltip插件. 1. 使用命令安装jQuery和bootstrap npm install bootstrap jquery --save ...
- 淘宝druid报错:javax.management.InstanceNotFoundException: com.alibaba.druid:type=DruidDataSourceStat
问题: 启动tomcat报错: Tomat报出一下异常:ERROR [com.alibaba.druid.stat.DruidDataSourceStatManager] – unregister m ...
- junit的Test不能使用,报错信息:Test is not an annotation type
在使用junit的Test做测试时,注解@Test报错”Test is not an annotation type”,发现是因为测试类的类名命名为了Test,所以导致错误. 测试类类名不能直接命名为 ...
随机推荐
- 1.后期特效合成AE概述&&工作流程&&磁盘缓存清理
1.简介: After Effects:是一款专业的后期制作与特效合成软件: 2.AE界面介绍 2.1 项目面板 2.2 合成预览面板 2.3 时间线面板 2.4 辅助面板 2 ...
- 2013.5.1 - KDD第十三天
今天把昨天的思路整理了一下,给中秋发过去了,还没回我. 然后就全天看代码了,把NER跟LTP的接口又过了一下.晚上师兄跟我约好这周六一起把LTP写完,到时候我们俩都早点过来. 这之前需要做的有: 1. ...
- MySQL中的char与varchar详解
mysql中char与varchar的区别: char:定长,效率高,一般用于固定长度的表单提交数据存储 :例如:身份证号,手机号,电话,密码等 varchar:不定长,效率偏低 1.varchar ...
- rest-framework频率组件、url注册器、响应器、分页器
频率组件 import time from rest_framework.throttling import BaseThrottle,SimpleRateThrottle IP_DICT = {} ...
- python开发基础-Pycharm快捷键
1.编辑(Editing) Ctrl + Space 基本的代码完成(类.方法.属性)Ctrl + Alt + Space 快速导入任意类Ctrl + Shift + Enter 语句完成Ctrl + ...
- Dubbo基础入门
Dubbo概述 Dubbo的背景 随着互联网的发展,网站应用的规模不断扩大,常规的垂直应用架构已无法应对,分布式服务架构以及流动计算架构势在必行,亟需一个治理系统确保架构有条不紊的演进. 单一应用架构 ...
- Centos6 克隆后简单的网络配置
第一步:修改主机名 $ vi /etc/sysconfig/network 第二步: $ vi /etc/udev/rules.d/70-persistent-net.rules 注: ...
- Django --- cookie与session,中间件
目录 1.cookie与session 1.cookie 2.session 2.中间件 1.中间件作用 2.用户可以自定义的五个方法 3.自定义中间件 1.cookie与session 1.cook ...
- 2019-2020-1 20199302《Linux内核原理与分析》第六周作业
一 .万能函数 1.过程抽象 (1)接口:指明模块要做什么,标识符/类型.函数等,.h ,函数调用者 (2)实现:指明模块如何完成接口,一个接口多个实现(可能),.c ,函数实现者 (3)函数签名:函 ...
- 001——CC2530——终端或者路由器传输到不同多协调器上
(一)参考文献:协调器太多,cc2530的终端或则路由器选择性加入协调器的方法 (二)频道和ID一样 进入协调器和终端和路由器的两个程序,找到Tools中的f8wConfig.cfg文件.修改默认PA ...