Why is it not possible to catch MissingMethodException?

后端 未结 4 579
深忆病人
深忆病人 2020-12-31 10:38

I have a dependency on .NET 2.0 SP2 in my ClickOnce deployed application (the ApplicationDeployment.CurrentDeployment.CheckForDetailedUpdate(false) method is SP

4条回答
  •  清酒与你
    2020-12-31 10:53

    You could use reflection to see whether the method exists.

    private void CheckDotNet2SP()
    {
        return typeof(WaitHandle).GetMethod("WaitOne", new Type[] { typeof(int) }) 
           != null;
    } 
    

提交回复
热议问题