复制文件
将mono-sgen.exe和其他文件复制到文件夹mono
将mono-sgen.exe重命名为mono.exe
将mscorlib.dll和其他文件复制到文件夹mono \ lib \ mono \ 4.5
然后测试hello.cs
using System;
namespace TestMONO
{
static class Program
{
static void Main()
{
Console.WriteLine("hello mono!");
Console.ReadLine();
}
}
}
5.cmd为单声道 lib \ mono \ 4.5 \ mcs hello.cs bin \ mono.exe hello.exe
6。错误信息如下: 未处理的异常: 检测到嵌套异常。 原始异常:在<887a017aab73435ea2a8d85ed2cb90e8>:0
中的TestMONO.Program.Main()[0x00000]Nested exception:at System.Text.StringBuilder.AppendFormatHelper (System.IFormatProvider,string,System.ParamsArray) [0x003a6] in <7ef7898f75d54dc2a73fabebfda62a
89>:0
at System.Text.StringBuilder.AppendFormat (string,object) [0x00009] in <7ef7898f75d54dc2a73fabebfda62a89>:0
at System.Diagnostics.StackTrace.AddFrames (System.Text.StringBuilder,bool,bool&) [0x0011f] in <7ef7898f75d54dc2a73fabebfda62a89>:0
at System.Diagnostics.StackTrace.ToString () [0x00083] in <7ef7898f75d54dc2a73fabebfda62a89>:0
at System.Diagnostics.StackTrace.ToString (System.Diagnostics.StackTrace/TraceFormat) [0x00001] in <7ef7898f75d54dc2a73fabebfda62a89>:0
at System.Environment.GetStackTrace (System.Exception,bool) [0x0001a] in <7ef7898f75d54dc2a73fabebfda62a89>:0
at System.Exception.GetStackTrace (bool) [0x00056] in <7ef7898f75d54dc2a73fabebfda62a89>:0
at System.Exception.ToString (bool,bool) [0x00099] in <7ef7898f75d54dc2a73fabebfda62a89>:0
at System.Exception.ToString (bool,bool) [0x00053] in <7ef7898f75d54dc2a73fabebfda62a89>:0
at System.Exception.ToString () [0x00001] in <7ef7898f75d54dc2a73fabebfda62a89>:0
[ERROR] FATAL UNHANDLED EXCEPTION: Nested exception detected.
Original Exception: at TestMONO.Program.Main () [0x00000] in <887a017aab73435ea2a8d85ed2cb90e8>:0
Nested exception:at System.Text.StringBuilder.AppendFormatHelper (System.IFormatProvider,string,System.ParamsArray) [0x003a6] in <7ef7898f75d54dc2a73fabebfda62a
89>:0
at System.Text.StringBuilder.AppendFormat (string,object) [0x00009] in <7ef7898f75d54dc2a73fabebfda62a89>:0
at System.Diagnostics.StackTrace.AddFrames (System.Text.StringBuilder,bool,bool&) [0x0011f] in <7ef7898f75d54dc2a73fabebfda62a89>:0
at System.Diagnostics.StackTrace.ToString () [0x00083] in <7ef7898f75d54dc2a73fabebfda62a89>:0
at System.Diagnostics.StackTrace.ToString (System.Diagnostics.StackTrace/TraceFormat) [0x00001] in <7ef7898f75d54dc2a73fabebfda62a89>:0
at System.Environment.GetStackTrace (System.Exception,bool) [0x0001a] in <7ef7898f75d54dc2a73fabebfda62a89>:0
at System.Exception.GetStackTrace (bool) [0x00056] in <7ef7898f75d54dc2a73fabebfda62a89>:0
at System.Exception.ToString (bool,bool) [0x00099] in <7ef7898f75d54dc2a73fabebfda62a89>:0
at System.Exception.ToString (bool,bool) [0x00053] in <7ef7898f75d54dc2a73fabebfda62a89>:0
at System.Exception.ToString () [0x00001] in <7ef7898f75d54dc2a73fabebfda62a89>:0
7。将我自己编译的mscorlib.dll替换为mono安装包中的文件(mono-5.18.0.225-gtksharp-2.12.45-win32-0.msi) 一切都很好,我得到了正确的结果。
发生了什么事以及如何解决? 谢谢!