Project Euler Problem 7: 10,001st prime
Aside from using a naive function to find prime, the GetPrimeOccurrence function could use some tightening up.  Most specifically the loop should use a shortcut and return as soon as the nth occurrence is reached:

static long GetPrimeOccurence(int NthOccurence)
{   
    if (NthOccurence==1)
        return 2;

    int primePosition=2;
    bool numberIsPrime =false;
    for (long testForPrime=3; primePosition &lt;= NthOccurence; testForPrime +=2)
    {
        numberIsPrime = IsPrime(testForPrime);

        if (numberIsPrime)
        {
            if(primePosition == NthOccurence)
            {
                return testForPrime;
            }
            primePosition++;
        }
    } 
    return 0;
}