关闭“生成序列化程序集"有什么好处? [英] What is the benefit of turning Generate Serialization Assemblies off?

查看:528
本文介绍了关闭“生成序列化程序集"有什么好处?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在构建项目时,Visual Studio中的生成序列化程序集"选项会创建MyAssembly.XmlSerializers.dll.这个问题( https ://stackoverflow.com/questions/934411/what-is-myassembly-xmlserializers-dll-generated-for )指出了它首先出现的原因,其中一些答案提供了将其打开的方法关闭,但是我的问题是为什么您会选择关闭它?在某些情况下打开它是否会引起问题(如果是,那是什么情况)?

The Generate Serialization Assemblies option in Visual Studio creates a MyAssembly.XmlSerializers.dll when my project is built. This question (https://stackoverflow.com/questions/934411/what-is-myassembly-xmlserializers-dll-generated-for) indicates a reason why it's there in the first place, and some of the answers provide ways to turn it off, but my question is why would you choose to turn it off? Does having it turned on cause problems in certain situations (and, if so, what are those situations)?

推荐答案

构建工具(例如msbuild)可能只面临您遇到的问题,因为如果在显式x64的程序集上使用x32 SDK中的sgen,则会产生一个生成时错误(您可以通过将正确的SGenToolPath路径设置为msbuild或目标MSIL来轻松解决此问题).恕我直言,最好解决构建时间问题并缩短启动时间.

Only problems you might be facing are with build tools - such as msbuild, because if you use sgen from x32 SDK on assembly that is explicitly x64 it will raise a build-time error (you can easily overcome this by setting correct SGenToolPath path to msbuild or target MSIL instead). IMHO it is better to deal with build time issues and have quicker startup time.

这篇关于关闭“生成序列化程序集"有什么好处?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆