[编辑]这实际上也发生在新创建的准系统 React+Typescript 模板 ViteJS 应用程序上,零修改。在 App.tsx 中放置断点会使 VS Code 调试器启动速度慢得难以忍受。原帖如下:
我正在尝试 ViteJS(也许不再使用react-create-app)。我使用 React Typescript 模板创建了一个准系统 Vite 应用程序。然后我引入了 DC.js、Mapbox 和其他一些库。
事情进展顺利几个小时,然后突然(我不知道我做了什么)启动 VS Code 调试器(pwa-chrome在我的启动配置中使用)开始花费很长时间。也就是说,它立即打开 Chrome,但它位于空白屏幕上,直到我的 VS Code 调试控制台写完以下警告:
WARNING: Processing source-maps of http://localhost:5173/node_modules/.vite/deps/chunk-YLBYPMLO.js?v=2e2948d4 took longer than 5679.765125 ms so we continued execution without waiting for all the breakpoints for the script to be set.
WARNING: Processing source-maps of http://localhost:5173/node_modules/.vite/deps/crossfilter2.js?v=2e2948d4 took longer than 1000.451959 ms so we continued execution without waiting for all the breakpoints for the script to …Run Code Online (Sandbox Code Playgroud) .NET中的XML序列化允许通过构造函数的extraTypes[]参数进行多态对象XmlSerializer.它还允许为实现的类型定制XML序列化IXmlSerializable.
但是,我无法将这两个功能结合起来 - 正如这个最小的例子所示:
using System;
using System.IO;
using System.Xml;
using System.Xml.Schema;
using System.Xml.Serialization;
namespace CsFoo
{
public class CustomSerializable : IXmlSerializable
{
public XmlSchema GetSchema() { return null; }
public void ReadXml(XmlReader xr) { }
public void WriteXml(XmlWriter xw) { }
}
class CsFoo
{
static void Main()
{
XmlSerializer xs = new XmlSerializer(
typeof(object),
new Type[] { typeof(CustomSerializable) });
xs.Serialize(new StringWriter(), new CustomSerializable());
}
}
Run Code Online (Sandbox Code Playgroud)
最后一行抛出System.InvalidOperationException此消息:
在此上下文中可能不使用类型CsFoo.CustomSerializable来使用CsFoo.CustomSerializable作为参数,返回类型或类或结构的成员,参数,返回类型或成员必须声明为类型CsFoo.CustomSerializable(它不能是对象).CsFoo.CustomSerializable类型的对象不能用于未类型的集合,例如ArrayLists.
通过动态生成的XML程序集,我们最终通过调用以回到.NET标准库代码:
System.Xml.Serialization.XmlSerializationWriter.WriteTypedPrimitive(
String, …Run Code Online (Sandbox Code Playgroud)