سؤال

I'm trying to run some service and I'm getting this message

Method not found: 'Void System.GC.Collect(Int32, System.GCCollectionMode)'

I suspect the server because this service runs on other servers. I really want to know what the source of this problem because I came across this problem on other servers. I try to take of code from my service and finally I realized that even I run a console application with only one static main and call the GC I get this error, I'm using Windows Server 2003 with Framework 2.0 and 3.5

هل كانت مفيدة؟

المحلول

When you create your console application make sure your target framework is not set to Client Profile FrameWork 3.5.

The above setting is in Application tab of your project properties

If you want to use GCCollectionMode and Framework 2.0 you will have to install .NET 2.0 Service Pack 1

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top