Mono Bug:幻数是错误的:542 [英] Mono Bug : Magic number is wrong: 542
问题描述
我正在尝试在Linux上的Rider中编译C#Hello World应用程序. 当我尝试运行该应用程序时,系统提示以下异常:
I am trying to compile a C# Hello World application in Rider on Linux. When I try to run the app, I am promted the following exception:
Unhandled Exception:
System.TypeInitializationException: The type initializer for 'System.Console' threw an exception. ---> System.TypeInitializationException: The type initializer for 'System.ConsoleDriver' threw an exception. ---> System.Exception: Magic number is wrong: 542
at System.TermInfoReader.ReadHeader (System.Byte[] buffer, System.Int32& position) [0x00028] in <a84b655e5e6a49ee96b338ec792f5580>:0
at System.TermInfoReader..ctor (System.String term, System.String filename) [0x0005f] in <a84b655e5e6a49ee96b338ec792f5580>:0
at System.TermInfoDriver..ctor (System.String term) [0x00055] in <a84b655e5e6a49ee96b338ec792f5580>:0
at System.ConsoleDriver.CreateTermInfoDriver (System.String term) [0x00000] in <a84b655e5e6a49ee96b338ec792f5580>:0
at System.ConsoleDriver..cctor () [0x0004d] in <a84b655e5e6a49ee96b338ec792f5580>:0
--- End of inner exception stack trace ---
at System.Console.SetupStreams (System.Text.Encoding inputEncoding, System.Text.Encoding outputEncoding) [0x00007] in <a84b655e5e6a49ee96b338ec792f5580>:0
at System.Console..cctor () [0x0008e] in <a84b655e5e6a49ee96b338ec792f5580>:0
--- End of inner exception stack trace ---
at TestCaseApp.Program.Main (System.String[] args) [0x00001] in <662667bfa1e4443ea031df076247d2d3>:0
[ERROR] FATAL UNHANDLED EXCEPTION: System.TypeInitializationException: The type initializer for 'System.Console' threw an exception. ---> System.TypeInitializationException: The type initializer for 'System.ConsoleDriver' threw an exception. ---> System.Exception: Magic number is wrong: 542
at System.TermInfoReader.ReadHeader (System.Byte[] buffer, System.Int32& position) [0x00028] in <a84b655e5e6a49ee96b338ec792f5580>:0
at System.TermInfoReader..ctor (System.String term, System.String filename) [0x0005f] in <a84b655e5e6a49ee96b338ec792f5580>:0
at System.TermInfoDriver..ctor (System.String term) [0x00055] in <a84b655e5e6a49ee96b338ec792f5580>:0
at System.ConsoleDriver.CreateTermInfoDriver (System.String term) [0x00000] in <a84b655e5e6a49ee96b338ec792f5580>:0
at System.ConsoleDriver..cctor () [0x0004d] in <a84b655e5e6a49ee96b338ec792f5580>:0
--- End of inner exception stack trace ---
at System.Console.SetupStreams (System.Text.Encoding inputEncoding, System.Text.Encoding outputEncoding) [0x00007] in <a84b655e5e6a49ee96b338ec792f5580>:0
at System.Console..cctor () [0x0008e] in <a84b655e5e6a49ee96b338ec792f5580>:0
--- End of inner exception stack trace ---
at TestCaseApp.Program.Main (System.String[] args) [0x00001] in <662667bfa1e4443ea031df076247d2d3>:0
我正在使用Antergos(Linux)和JetBrains Rider 2017.3.1 版本#RD-173.3994.2442 我正在使用Mono 5.4.1.7-2
I am using Antergos (Linux) and JetBrains Rider 2017.3.1 Build #RD-173.3994.2442 I have am using Mono 5.4.1.7-2
我对此漏洞进行了一些研究,发现:
I did some research about this bug and I found:
https://github.com/mono/mono/issues/6752# issuecomment-365212655
这些主题中提到的所有内容都无法帮助我解决此问题.我该怎么办?
Everything mentioned in these threads didn't help me to fix this issue. What can I do?
推荐答案
您是否没有遵循该页面上的说明?您需要将TERM
环境变量设置为xterm
作为解决方法:
Did you not follow the instructions on that page? You need to set your TERM
environmental variable to xterm
as a fix:
export TERM=xterm
然后使用以下方法验证它是否已更改:
Then verify it is changed with:
echo $TERM
这篇关于Mono Bug:幻数是错误的:542的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!