Could not load file or assembly 'MyAssembly.XmlSerializers
https://stackoverflow.com/questions/17755559/could-not-load-file-or-assembly-myassembly-xmlserializers
There's an answer already here. Apparently this is "expected behaviour" that MS isn't going to fix.
The first comment has a workaround:
One of the possible ways to get rid of this problem is check "Just my code" option in Tools -> Options -> Debugging -> General options
https://stackoverflow.com/questions/1127431/xmlserializer-giving-filenotfoundexception-at-constructor
Like Martin Sherburn said, this is normal behavior. The constructor of the XmlSerializer first tries to find an assembly named [YourAssembly].XmlSerializers.dll which should contain the generated class for serialization of your type. Since such a DLL has not been generated yet (they are not by default), a FileNotFoundException is thrown. When that happenes, XmlSerializer's constructor catches that exception, and the DLL is generated automatically at runtime by the XmlSerializer's constructor (this is done by generating C# source files in the %temp% directory of your computer, then compiling them using the C# compiler). Additional constructions of an XmlSerializer for the same type will just use the already generated DLL.
UPDATE: Starting from .NET 4.5,
XmlSerializerno longer performs code generation nor does it perform compilation with the C# compiler in order to create a serializer assembly at runtime, unless explicitly forced to by setting a configuration file setting (useLegacySerializerGeneration). This change removes the dependency oncsc.exeand improves startup performance. Source: .NET Framework 4.5 Readme, section 1.3.8.1.
The exception is handled by XmlSerializer's constructor. There is no need to do anything yourself, you can just click 'Continue' (F5) to continue executing your program and everything will be fine. If you're bothered by the exceptions stopping the execution of your program and popping up an exception helper, you either have 'Just My Code' turned off, or you have the FileNotFoundException set to break execution when thrown, instead of when 'User-unhandled'.
To enable 'Just My Code', go to Tools >> Options >> Debugging >> General >> Enable Just My Code. To turn off breaking of execution when FileNotFound is thrown, go to Debug >> Exceptions >> Find >> enter 'FileNotFoundException' >> untick the 'Thrown' checkbox from System.IO.FileNotFoundException.
Could not load file or assembly 'MyAssembly.XmlSerializers的更多相关文章
- error_Could not load file or assembly
原文链接 Could you be missing the loaded assembly from your configuration file? Ensure you have somethin ...
- configuration error-could not load file or assembly crystaldecisions.reportappserver.clientdoc
IIS启动网站后报错: configuration error Could not load file or assembly 'crystaldecisions.reportappserver.cl ...
- Could not load file or assembly 'Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its de
页面加载时出现这个错误: Could not load file or assembly 'Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Cul ...
- Could not load file or assembly 'System.ServiceModel.DomainServices.Hosting'.系统找不到指定文件
项目部署到服务器后出现如下错误信息: Parser Error Message: Could not load file or assembly 'System.ServiceModel.Domain ...
- ASP.NET corrupt assembly “Could not load file or assembly App_Web_*
以下是从overFlow 复制过来的问题 I've read through many of the other questions posted on the same issue, but I s ...
- Could not load file or assembly 'Microsoft.SqlServer.Management.Sdk.Sfc, Version=11.0.0.0 系统找不到指定的文件。
环境: web服务器: ip:192.168.1.32 ,安装有 Visual Studio Premium 2013 操作系统: Microsoft Server 2008 r2+sp1 数据库服 ...
- NopCommerce 发布时 Could not load file or assembly 'file:///...\Autofac.3.5.2\lib\net40\Autofac.dll' or one of its dependencies
本文转自:http://www.nopcommerce.com/boards/t/33637/4-errors.aspx 问题: The 3.5 solution compiles fine, and ...
- Could not load file or assembly 'MySql.Data.CF,
Could not load file or assembly 'MySql.Data.CF, Version=6.4.4.0, Culture=neutral, PublicKeyToken=c56 ...
- Could not load file or assembly 'System.Data.SQLite' or one of its dependencies
试图加载格式不正确的程 异常类型 异常消息Could not load file or assembly 'System.Data.SQLite' or one of its dependencies ...
随机推荐
- vue之二级路由
router-view : <router-view> 组件是一个 functional 组件,渲染路径匹配到的视图组件 一 样式 1 在一个vue组件,<template>& ...
- ctrl+c,ctrl+d,ctrl+z在linux程序中意义和区别
原文: http://blog.csdn.net/sxhlovehmm/article/details/41318111 [侵删] ctrl+c和ctrl+z都是中断命令,但是他们的作用却不一样. ...
- js-判断当前页面是否在微信浏览器中打开
方案一:推荐 var ua = navigator.userAgent.toLowerCase(); var isWinxin = ua.indexOf('micromessenger') != -1 ...
- Java利用Mybatis进行数据权限控制
权限控制主要分为两块,认证(Authentication)与授权(Authorization).认证之后确认了身份正确,业务系统就会进行授权,现在业界比较流行的模型就是RBAC(Role-Based ...
- IIS Express 的怪毛病 vs2013本机调试
本机调试时,如果同一个项目有多个版本,同时debug,可能会串项目调试,造成不必要的困扰: 通常情况下是 IIS express的映射出现了问题: 解决方案: 1.打开目录:查看文件C:\Users\ ...
- scapy在wlan中的应用
Scapy 又是scapy,这是python的一个网络编程方面的库,它在wlan中也有很强大的应用.一般我们买块网卡,然后aircrack-ng套件爆破一下邻居的密码,其实我们可以用scapy写一些有 ...
- 阿里云OSS 图片处理api(custom)
阿里云OSS 图片处理api(custom) 阿里云对象存储服务(Object Storage Service, 简称OSS) 学习了:https://blog.csdn.net/u014559227 ...
- SODBASE CEP学习(四)续:类SQL语言EPL与Storm或jStorm集成-使用分布式缓存
流式计算在一些情况下会用到分布式缓存,从而实现(1)想把统计或计算结果保存在分布缓存中.供其他模块或其他系统调用. (2)某一滑动时间窗体上计数.比如实时统计1小时每一个Cookie的訪问量.实时统计 ...
- react 创建组件 (二)component
因为ES6对类和继承有语法级别的支持,所以用ES6创建组件的方式更加优雅,下面是示例: import React from 'react'; class Greeting extends React. ...
- h5 录音 自动生成proto Js语句 UglifyJS-- 对你的js做了什么 【原码笔记】-- protobuf.js 与 Long.js 【微信开发】-- 发送模板消息 能编程与会编程 vue2入坑随记(二) -- 自定义动态组件 微信上传图片
得益于前辈的分享,做了一个h5录音的demo.效果图如下: 点击开始录音会先弹出确认框: 首次确认允许后,再次录音不需要再确认,但如果用户点击禁止,则无法录音: 点击发送 将录音内容发送到对话框中.点 ...