Windows Phone Developers

Wednesday, December 23, 2009

Cannot declare instance members in a static class

This error occurs if you declare a non-static member in a class that is declared static. It is not possible to create instances of static classes, so instance variables would not be meaningful. The static keyword should be applied to all members of static classes.

In this example get_application_process is not declared as static

static class Program

{

private void get_application_process()

{

Process apProcess;

String sModuleName;

}

Solution:

private static void get_application_process()

should solve the problem

Digg Technorati Delicious StumbleUpon Reddit BlinkList Furl Mixx Facebook Google Bookmark Yahoo
ma.gnolia squidoo newsvine live netscape tailrank mister-wong blogmarks slashdot spurl StumbleUpon

No comments:

Post a Comment

kbAlertz.com :: Visual Studio 2005

kbAlertz.com :: Visual Studio 2008

kbAlertz.com :: Visual Basic 2005