C#: how do I list all System defined Exceptions and pick up what I need

Ah, in actual fact, there's a better way I just found:

VS -> Debug -> Exceptions...

Or keys: Ctrl + D, E

You can see all the Exceptions, especially in 'Common Language Runtime Exceptions -> System'


==============================================================

Press F1 when cursor is on 'Exception', Visual Studio leads you to the MSDN.

 

Choose 'Exception Class' -> 'Inheritance Hierarchy' -> 'More', then all Exceptions which are derived from Exception are listed. Choose what you need by reading their names.

 

Inheritance Hierarchy


System.Object
   System.Exception
     Microsoft.Build.BuildEngine.InternalLoggerException
     Microsoft.Build.BuildEngine.InvalidProjectFileException
     Microsoft.Build.BuildEngine.InvalidToolsetDefinitionException
     Microsoft.Build.BuildEngine.RemoteErrorException
     Microsoft.Build.Exceptions.BuildAbortedException
     Microsoft.Build.Exceptions.InternalLoggerException
     Microsoft.Build.Exceptions.InvalidProjectFileException
     Microsoft.Build.Exceptions.InvalidToolsetDefinitionException
     Microsoft.Build.Framework.LoggerException
     Microsoft.CSharp.RuntimeBinder.RuntimeBinderException
     Microsoft.CSharp.RuntimeBinder.RuntimeBinderInternalCompilerException
     Microsoft.JScript.CmdLineException
     Microsoft.JScript.ParserException
     Microsoft.VisualBasic.ApplicationServices.CantStartSingleInstanceException
     Microsoft.VisualBasic.ApplicationServices.NoStartupFormException
     Microsoft.VisualBasic.Compatibility.VB6.WebClassContainingClassNotOptional
     Microsoft.VisualBasic.Compatibility.VB6.WebClassCouldNotFindEvent
     Microsoft.VisualBasic.Compatibility.VB6.WebClassNextItemCannotBeCurrentWebItem
     Microsoft.VisualBasic.Compatibility.VB6.WebClassNextItemRespondNotFound
     Microsoft.VisualBasic.Compatibility.VB6.WebClassUserWebClassNameNotOptional
     Microsoft.VisualBasic.Compatibility.VB6.WebClassWebClassFileNameNotOptional
     Microsoft.VisualBasic.Compatibility.VB6.WebClassWebItemNotValid
     Microsoft.VisualBasic.Compatibility.VB6.WebItemAssociatedWebClassNotOptional
     Microsoft.VisualBasic.Compatibility.VB6.WebItemClosingTagNotFound
     Microsoft.VisualBasic.Compatibility.VB6.WebItemCouldNotLoadEmbeddedResource
     Microsoft.VisualBasic.Compatibility.VB6.WebItemCouldNotLoadTemplateFile
     Microsoft.VisualBasic.Compatibility.VB6.WebItemNameNotOptional
     Microsoft.VisualBasic.Compatibility.VB6.WebItemNoTemplateSpecified
     Microsoft.VisualBasic.Compatibility.VB6.WebItemTooManyNestedTags
     Microsoft.VisualBasic.Compatibility.VB6.WebItemUnexpectedErrorReadingTemplateFile
     Microsoft.VisualBasic.CompilerServices.IncompleteInitialization
     Microsoft.VisualBasic.CompilerServices.InternalErrorException
     Microsoft.VisualBasic.FileIO.MalformedLineException
     System.Activities.ExpressionParser.SourceExpressionException
     System.Activities.Expressions.LambdaSerializationException
     System.Activities.InvalidWorkflowException
     System.Activities.Presentation.Metadata.AttributeTableValidationException
     System.Activities.Statements.WorkflowTerminatedException
     System.Activities.WorkflowApplicationException
     System.AddIn.Hosting.AddInSegmentDirectoryNotFoundException
     System.AddIn.Hosting.InvalidPipelineStoreException
     System.AggregateException
     System.ApplicationException
     System.ComponentModel.Composition.CompositionContractMismatchException
     System.ComponentModel.Composition.CompositionException
     System.ComponentModel.Composition.ImportCardinalityMismatchException
     System.ComponentModel.Composition.Primitives.ComposablePartException
     System.ComponentModel.DataAnnotations.ValidationException
     System.ComponentModel.Design.ExceptionCollection
     System.Configuration.Provider.ProviderException
     System.Configuration.SettingsPropertyIsReadOnlyException
     System.Configuration.SettingsPropertyNotFoundException
     System.Configuration.SettingsPropertyWrongTypeException
     System.Data.Linq.ChangeConflictException
     System.Diagnostics.Eventing.Reader.EventLogException
     System.DirectoryServices.ActiveDirectory.ActiveDirectoryObjectExistsException
     System.DirectoryServices.ActiveDirectory.ActiveDirectoryObjectNotFoundException
     System.DirectoryServices.ActiveDirectory.ActiveDirectoryOperationException
     System.DirectoryServices.ActiveDirectory.ActiveDirectoryServerDownException
     System.DirectoryServices.Protocols.DirectoryException
     System.IdentityModel.Selectors.CardSpaceException
     System.IdentityModel.Selectors.IdentityValidationException
     System.IdentityModel.Selectors.PolicyValidationException
     System.IdentityModel.Selectors.ServiceBusyException
     System.IdentityModel.Selectors.ServiceNotStartedException
     System.IdentityModel.Selectors.StsCommunicationException
     System.IdentityModel.Selectors.UnsupportedPolicyOptionsException
     System.IdentityModel.Selectors.UntrustedRecipientException
     System.IdentityModel.Selectors.UserCancellationException
     System.InvalidTimeZoneException
     System.IO.IsolatedStorage.IsolatedStorageException
     System.IO.Log.SequenceFullException
     System.Management.Instrumentation.InstrumentationBaseException
     System.Management.Instrumentation.WmiProviderInstallationException
     System.Net.Mail.SmtpException
     System.Net.PeerToPeer.PeerToPeerException
     System.Runtime.CompilerServices.RuntimeWrappedException
     System.Runtime.DurableInstancing.InstancePersistenceException
     System.Runtime.Remoting.MetadataServices.SUDSGeneratorException
     System.Runtime.Remoting.MetadataServices.SUDSParserException
     System.Runtime.Serialization.InvalidDataContractException
     System.Security.RightsManagement.RightsManagementException
     System.ServiceModel.Channels.InvalidChannelBindingException
     System.SystemException
     System.Threading.BarrierPostPhaseException
     System.Threading.LockRecursionException
     System.Threading.Tasks.TaskSchedulerException
     System.TimeZoneNotFoundException
     System.Web.Query.Dynamic.ParseException
     System.Web.Security.MembershipCreateUserException
     System.Web.Security.MembershipPasswordException
     System.Web.UI.ViewStateException
     System.Web.UI.WebControls.EntityDataSourceValidationException
     System.Web.UI.WebControls.LinqDataSourceValidationException
     System.Windows.Automation.NoClickablePointException
     System.Windows.Automation.ProxyAssemblyNotLoadedException
     System.Windows.Controls.PrintDialogException
     System.Windows.Forms.AxHost.InvalidActiveXStateException
     System.Windows.Xps.XpsException
     System.Windows.Xps.XpsWriterException
     System.Workflow.Activities.Rules.RuleException
     System.Workflow.ComponentModel.Compiler.WorkflowValidationFailedException
     System.Workflow.ComponentModel.Serialization.WorkflowMarkupSerializationException
     System.Workflow.ComponentModel.WorkflowTerminatedException
     System.Workflow.Runtime.WorkflowOwnershipException
     System.Xaml.XamlException

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值