C#编译错误:[否合乎逻辑的剩余空间,创造更多的用户串" [英] C# compile error: "No logical space left to create more user strings"

查看:330
本文介绍了C#编译错误:[否合乎逻辑的剩余空间,创造更多的用户串"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图编译一个一次性的脚本,自动生成的C#程序。这个程序拥有12万不同的字符串。 C#编译器不能建立这一点,他说:

I am trying to compile a one-off "script", an autogenerated C# program. This program contains 120,000 different string literals. The C# compiler can't build this, saying:

Unexpected error writing metadata to file '<removed>' -- 'No logical space left to create more user strings.'

有没有在.NET上字符串的头号可以在一个模块中的硬限制?这是什么限制?有周围没有任何办法?

Is there a hard limit in .NET on the number of string literals one can have in a module? What is this limit? Is there any way around it?

推荐答案

上有串在装配的数量进行了限制,只因为有所有这些标识上的班级人数的限制,田野等。有32位元数据标记,其中最上面的字节是一个元类型 - code和下位是个人数据记录。对于字符串,它们实际上确定一个偏移量字符串堆,所以你可以有最多2 ** 24个字节的字符串,例如16MiB。不知道是否字符串存储在UTF-8或UTF-16。

There is a limit on the number of strings in an assembly, just as there are limits on the number of classes, fields, etc. Each of these is identified with a 32-bit metadata token, where the upper-most byte is a meta-type-code, and the lower bits are the individual data record. For strings, they actually identify an offset into the string heap, so you can have at most 2**24 bytes for strings, i.e. 16MiB. Not sure whether strings are stored in UTF-8 or UTF-16.

这篇关于C#编译错误:[否合乎逻辑的剩余空间,创造更多的用户串&QUOT;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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