1. <small id='Ko9ys'></small><noframes id='Ko9ys'>

      • <bdo id='Ko9ys'></bdo><ul id='Ko9ys'></ul>

    1. <tfoot id='Ko9ys'></tfoot>
      <i id='Ko9ys'><tr id='Ko9ys'><dt id='Ko9ys'><q id='Ko9ys'><span id='Ko9ys'><b id='Ko9ys'><form id='Ko9ys'><ins id='Ko9ys'></ins><ul id='Ko9ys'></ul><sub id='Ko9ys'></sub></form><legend id='Ko9ys'></legend><bdo id='Ko9ys'><pre id='Ko9ys'><center id='Ko9ys'></center></pre></bdo></b><th id='Ko9ys'></th></span></q></dt></tr></i><div id='Ko9ys'><tfoot id='Ko9ys'></tfoot><dl id='Ko9ys'><fieldset id='Ko9ys'></fieldset></dl></div>
      <legend id='Ko9ys'><style id='Ko9ys'><dir id='Ko9ys'><q id='Ko9ys'></q></dir></style></legend>

      无法生成临时类(结果=1).错误 CS0030:无法将类型“

      时间:2023-06-04
    2. <tfoot id='BbAg8'></tfoot>

          <bdo id='BbAg8'></bdo><ul id='BbAg8'></ul>
          1. <i id='BbAg8'><tr id='BbAg8'><dt id='BbAg8'><q id='BbAg8'><span id='BbAg8'><b id='BbAg8'><form id='BbAg8'><ins id='BbAg8'></ins><ul id='BbAg8'></ul><sub id='BbAg8'></sub></form><legend id='BbAg8'></legend><bdo id='BbAg8'><pre id='BbAg8'><center id='BbAg8'></center></pre></bdo></b><th id='BbAg8'></th></span></q></dt></tr></i><div id='BbAg8'><tfoot id='BbAg8'></tfoot><dl id='BbAg8'><fieldset id='BbAg8'></fieldset></dl></div>
                <tbody id='BbAg8'></tbody>
                <legend id='BbAg8'><style id='BbAg8'><dir id='BbAg8'><q id='BbAg8'></q></dir></style></legend>

              • <small id='BbAg8'></small><noframes id='BbAg8'>

                本文介绍了无法生成临时类(结果=1).错误 CS0030:无法将类型“Type[]"转换为“Type"?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                问题描述

                限时送ChatGPT账号..

                我使用 xsd.exe 工具从我的 xsd 文件创建了一个类后收到此错误.所以我在网上搜索并找到了解决方案.这是链接:http://satov.blogspot.com/2006/12/xsdexe-generated-classes-causing.html

                I get this error after I created a class from my xsd file using the xsd.exe tool. So I searched the net and found a solution. Here is the link: http://satov.blogspot.com/2006/12/xsdexe-generated-classes-causing.html

                问题是这会使代码运行,但反序列化的数据似乎已损坏.我按照网站的建议做了,最后第二个数组维度总是空的(见网站的评论,有人也有这个问题).问题是,我现在该如何解决这个问题?是否有其他工具可以创建 xsd 文件?我尝试了 Xsd2Code,但没有成功.

                Problem is that this makes the code run, but somehow the deserialized data seems corrupt. I did what the site suggests and in the end the 2nd array dimension is always empty (see the comments of the site, somebody also had this problem). Question is, how do I solve this issue now? Is there another tool to create the xsd file? I tried Xsd2Code, without success.

                谢谢:-)

                推荐答案

                需要更改序列化类中成员变量的类型.例如,如果它引发如下错误:

                You need to change the type of a member variable in the serialized class. For example if its raising an error like:

                无法生成临时类(结果=1).错误 CS0030:无法将类型Data[]"转换为Data".

                Unable to generate a temporary class (result=1). error CS0030: Cannot convert type 'Data[]' to 'Data'.

                我在生成的文件中搜索了数据类型名称,发现了这个:

                I ran a search on the Data type name in the generated file, and I found this:

                [System.Xml.Serialization.XmlArrayItemAttribute("Data", typeof(Data), IsNullable=false)]
                public Data[][] Row
                

                Data[][] 替换为 Data[] - 将 Data 的类型从 2D 数组更改为 1D 数组.它会解决你的问题.:)

                Replace Data[][] with Data[] - Change the type of Data from a 2D array to a 1D array. It would solve your problem. :)

                这篇关于无法生成临时类(结果=1).错误 CS0030:无法将类型“Type[]"转换为“Type"?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                上一篇:xsi:type 属性搞乱了 C# XML 反序列化 下一篇:将 XSD 转换为 SQL 关系表

                相关文章

                最新文章

                  <bdo id='hgWkk'></bdo><ul id='hgWkk'></ul>

                <tfoot id='hgWkk'></tfoot>
              • <legend id='hgWkk'><style id='hgWkk'><dir id='hgWkk'><q id='hgWkk'></q></dir></style></legend>

                1. <small id='hgWkk'></small><noframes id='hgWkk'>

                    <i id='hgWkk'><tr id='hgWkk'><dt id='hgWkk'><q id='hgWkk'><span id='hgWkk'><b id='hgWkk'><form id='hgWkk'><ins id='hgWkk'></ins><ul id='hgWkk'></ul><sub id='hgWkk'></sub></form><legend id='hgWkk'></legend><bdo id='hgWkk'><pre id='hgWkk'><center id='hgWkk'></center></pre></bdo></b><th id='hgWkk'></th></span></q></dt></tr></i><div id='hgWkk'><tfoot id='hgWkk'></tfoot><dl id='hgWkk'><fieldset id='hgWkk'></fieldset></dl></div>