Click here to Skip to main content
12,813,879 members (30,969 online)
Click here to Skip to main content
Add your own
alternative version

Tagged as


2 bookmarked
Posted 28 Sep 2013

The Type Caught or Thrown Must be Derived from System.Exception

, 28 Sep 2013 CPOL
Rate this:
Please Sign up or sign in to vote.
The type caught or thrown must be derived from System.Exception

Today I received a random error, the error message read “The type caught or thrown must be derived from System.Exception”. The reason why this was to me a random error was because I was trying to catch a Microsoft.TeamFoundation.WorkItemTracking.Client.ServerRejectedChangesException exception.


To try and see if maybe this was a bug or maybe my PC needed a reboot or something, I started drilling into the definitions of the exception to try and get all the way through to System.Exception.

Basically, this looked like below:

public class ServerRejectedChangesException : ValidationException


public class ValidationException : ClientException


public class ClientException : TeamFoundationServerException


public class TeamFoundationServerException : 

At the TeamFoundationServerException class, I noticed that the VssException was not lit up by Visual Studio which to me meant that I didn’t have a reference added to be able to drill into its definition like I was for the previous levels.

I added a reference to Microsoft.VisualStudio.Services.Common and suddenly the error being thrown when trying to build my project went away. Basically, this allowed the IDE to navigate through to System.Exception like below:

public abstract class VssException : ApplicationException


public class ApplicationException : Exception


public class Exception : ISerializable, _Exception

It would be cool if this extra reference was not needed, but I understand why it is Smile.


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Gordon Beeming (RSA)
Software Developer Derivco
South Africa South Africa
Gordon Beeming is a Software Developer at Derivco in the sunny city of Durban, South Africa. He spends most his time hacking away at the keyboard in Visual Studio or with his family relaxing. He is a Visual Studio ALM Rangers, Visual Studio ALM MVP and Friend of Red Gate. His blog is at and you can follow him on Twitter at

You may also be interested in...


Comments and Discussions

-- There are no messages in this forum --
Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.170308.1 | Last Updated 28 Sep 2013
Article Copyright 2013 by Gordon Beeming (RSA)
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid