System.GC.RunFinalizers()位于何处? [英] Where is System.GC.RunFinalizers() Located?
问题描述
我看到其他人引用方法,但如果我包含
System.GC.RunFinalizers()
我得到错误'System.GC'没有包含'RunFinalizers'的定义
System.GC.Collect();
运行良好。我如何运行RunFinalizers方法?它似乎不是GC类的成员: http: //msdn.microsoft.com/en-us/library/system.gc.aspx
编辑:
在这里可以找到这个方法的引用:
这个方法从来没有在.Net BCL中可用。
但似乎这种方法确实可用,直到.net 1.0 beta 2,然后从后续版本中删除。要得到关于.net 1.0 beta版本的任何信息是非常困难的,但是通过查看以下代码可以得出一个推论(虽然不是万无一失):
来源:< CodeForge
protected void Form1_Closing(object sender,System.ComponentModel.CancelEventArgs e)
{
ci = null;
System.GC.RunFinalizers();
Application.ExitThread();
Application.Exit();
}
上述代码的作者正在使用这个函数。 / p>
Exes包含在下载中(这意味着作者能够成功构建应用程序)。现在创建源文件和exes的日期是2001年2月,当时只有.Net Framework 1.0 beta 2可用。所以上述代码的作者很有可能在.Net 1.0 beta2中构建它。
I see others reference the method but If I include
System.GC.RunFinalizers()
I get the error 'System.GC' does not contain a definition for 'RunFinalizers'
System.GC.Collect();
runs fine. How can I run the method RunFinalizers? It doesn't seem to be a member of the GC class: http://msdn.microsoft.com/en-us/library/system.gc.aspx
Edit: A reference to this method can be found here:
This method has never been available in .Net BCL.
But it seems like this method was indeed available till .net 1.0 beta 2 and then removed from subsequent builds. It is very difficult to get any information regarding .net 1.0 beta versions but an inference (not foolproof though) can be drawn by looking at the following code:
Source: CodeForge
protected void Form1_Closing(object sender, System.ComponentModel.CancelEventArgs e)
{
ci=null;
System.GC.RunFinalizers();
Application.ExitThread();
Application.Exit();
}
The author of the above code is using this function.
Exes are included in the download (meaning thereby that the author was able to successfully build the application). Now the date of creation of source files and exes are Feb 2001 at which time only .Net Framework 1.0 beta 2 was available. So in all probability the author of the above code built it against .Net 1.0 beta2.
这篇关于System.GC.RunFinalizers()位于何处?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!