[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.
 
 
Well... the first error says that you can't do that... from http://msdn.microsoft.com/en-us/library/system.nonserializedattribute.aspx
 [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的更多相关文章

  1. notification 报错the method build() is undefined for the type Notificatin.Builder

    notification 报错the method build() is undefined for the type Notificatin.Builder 这事api版本号太低导致的 Notifi ...

  2. Eclipse怎么忽略掉报错的js文件

    第一步,我们要先定位错误在哪里,选择菜单里window——show view——other,选择Problems. 第二步,点击有红叉的项目,在Problems视图中,可以看到是什么错,哪个文件夹中的 ...

  3. 对象逆序列化报错:java.lang.ClassNotFoundException

    简单的想从保存的对象中又一次解析出对象.用了逆序列化,但是报错: java.lang.ClassNotFoundException: xxxxxxxxxxxx at java.net.URLClass ...

  4. MyEclipse忽略js报错

    MyEclipse对官网下载的js报错,解决办法如下: 1. 对js文件右键选择 MyEclipse --> Exclude From Validation 2. 然后继续右键执行MyEclip ...

  5. ref 属性使用eslint报错

    react 使用 ref 报错 ,[eslint] Using string literals in ref attributes is deprecated. (react/no-string-re ...

  6. angular中datetime-local属性使用ng-model报错

    项目需求是将年月日格式更改为年月日时分的格式展示,翻遍了整个项目没找到符合的组件,自己现敲一个也来不及,只好直接使用原生自带的组件--datetime-local.之前都是用的vue写项目,第一次接触 ...

  7. 在angular项目中使用bootstrap的tooltip插件时,报错Property 'tooltip' does no t exist on type 'JQuery<HTMLElement>的解决方法和过程

    在angular4的项目中需要使用bootstrap的tooltip插件. 1. 使用命令安装jQuery和bootstrap npm install bootstrap jquery --save ...

  8. 淘宝druid报错:javax.management.InstanceNotFoundException: com.alibaba.druid:type=DruidDataSourceStat

    问题: 启动tomcat报错: Tomat报出一下异常:ERROR [com.alibaba.druid.stat.DruidDataSourceStatManager] – unregister m ...

  9. junit的Test不能使用,报错信息:Test is not an annotation type

    在使用junit的Test做测试时,注解@Test报错”Test is not an annotation type”,发现是因为测试类的类名命名为了Test,所以导致错误. 测试类类名不能直接命名为 ...

随机推荐

  1. wget下载出现错误 403:Forbidden

    在我尝试wget下载一张图片的时候,出现了如下错误: wget "https://k4b8k3x5.ssl.hwcdn.net/content/140516/1622-saaya-irie- ...

  2. Kubernetes系统基础

    Kubernetes系统基础 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 一.容器编排系统概述 1>.容器编排系统生态圈 Docker通过“镜像”机制极富创造性地解决了应用 ...

  3. 安装CDH 5.15.1详解

    安装CDH 5.15.1详解 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任.  一.安装Cloudera Manager 和CDH 1>.登陆Cloudera Manager ...

  4. Photozoom图像放大的技术一二事

    平行空间下,未知的可能不仅仅是这个世界,还可能是前所未有的未知的探索.那么对于微小型世界来说,我们就需要借助技术的支撑来发现.photozoom就好比是“电子的放大镜”,对我们清晰图像的放大起到了重要 ...

  5. 使用VS.NET2019做为C++开发专用IDE

    一.下载安装包: https://visualstudio.microsoft.com/zh-hans/downloads/ 我下载的是企业版本. 二.安装支持C++ 序列号: Visual Stud ...

  6. ymPrompt简介

    ymPrompt从最简单的1.0版本到现在的4.0版本,代码共经历了四次较大的改动,组件在功能上有了很大的改进,应用灵活度更大,可应用环境的环境更加广泛,特别在4.0版本中加入对遮罩显示隐藏.按钮/图 ...

  7. 32位JVM和64位JVM的最大堆内存分别是多数?32位和64位的JVM,int类型变量的长度是多数?

    理论上说上 32 位的 JVM 堆内存可以到达 2^32,即 4GB,但实际上会比这个小很多.不同操作系统之间不同,如 Windows 系统大约 1.5 GB,Solaris 大约 3GB.64 位 ...

  8. Python win32gui调用窗口到最前面

    Python win32gui调用窗口到最前面 0要写一个轮询几个重要页面的程序,不停的在大屏上进行刷新,通过pywin32模块下的SetForegroundWindow函数调用时,会出现error: ...

  9. Default Trace 查找日志文件快速增长的原因

    select loginname, loginsid, spid, hostname, applicationname, servername, databasename, objectname, e ...

  10. YAML_01 YAML语法和playbook写法

    ansible的playbook采用yaml语法,它简单地实现了json格式的事件描述.yaml之于json就像markdown之于html一样,极度简化了json的书写.在学习ansible pla ...