Mono发生了什么事? [英] What is going on with Mono?

查看:98
本文介绍了Mono发生了什么事?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使.NET 2应用程序在Linux环境中运行。所以我编写了阅读XML文档的代码



这样的东西:



I am trying to make a .NET 2 application to run on a Linux environment. So I write code for reading XML document

Something like this:

XmlDocument xmldoc = new XmlDocument();
xmldoc.Load(SettingsName);
XmlNodeList xmlNodeList= xmldoc.SelectNodes("/settings/devicesettings/");





在此之后,我带着

来预约XmlNodeList



After that I foreach the XmlNodeList with

foreach (XmlNode xn in xmlNodeList)



但是当它到达


But when it reaches the

foreach





抛出异常:





Throws exception:

An exception was thrown by the type initializer for System.Console





InnerException



InnerException

Exception: handle
   Parameter name: Invalid.
   StackTrace: System.ArgumentException: handle
   Parameter name: Invalid.
     at System.IO.FileStream..ctor (IntPtr handle, FileAccess access, Boolean ownsHandle, Int32 bufferSize, Boolean isAsync, Boolean isZeroSize) [0x00000] in <filename unknown>:0
     at (wrapper remoting-invoke-with-check) System.IO.FileStream:.ctor (intptr,System.IO.FileAccess,bool,int,bool,bool)
     at System.Console.Open (IntPtr handle, FileAccess access, Int32 bufferSize) [0x00000] in <filename unknown>:0
     at System.Console.OpenStandardError (Int32 bufferSize) [0x00000] in <filename unknown>:0
     at System.Console..cctor () [0x00000] in <filename unknown>:0



那么请提出建议和原因?


So please advice what and why is going on?

推荐答案

这是一个单声道的bug。尝试将您的单声道版本更新为最新版本。您可以直接从Mono项目获取最新版本。不要依赖发行版本,因为它们通常远远落后于官方最新版本:

http://www.mono-project.com/docs/getting-started/install/linux/ [ ^ ]
It's a mono bug. Try updating your mono version to the latest available. You can get the latest version directly from the Mono project. Don't rely on the distribution packed version, because usualy they are far behind the official latest version:
http://www.mono-project.com/docs/getting-started/install/linux/[^]


这篇关于Mono发生了什么事?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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