locked
ApplicationException cannot be found

    Question

  • I'm using System, and I can access Exception or ArgumentException without problem, but ApplicationException appears not to exist.  Is this removed from Modern apps?  I can't find any documentation for such a retraction.  It is still there in .NET 4.5 documents with no warnings.  What might be the reason it is failing to compile?

    The type or namespace name 'ApplicationException' could not be found (are you missing a using directive or an assembly reference?)

    Friday, May 02, 2014 12:24 AM

Answers

  • The ApplicationException documentation does not list .Net For Windows Store apps in its supported Versions section. Classes and methods that are available will say so in the Versions section and will be marked with a green shopping bag icon. You can also use the Object Browser in Visual Studio to list just the classes which apply to your solution.

    See these snips from the ArgumentException class which indicate that they are supported:

    Also note the remarks in the ApplicationException page which recommend using Exception directly rather than ApplicationException.

    Friday, May 02, 2014 7:29 AM
    Owner

All replies

  • Hi,

    Windows store  apps use a subset of .Net 4.5 and cannot use any namespaces or classes which are not part of that subset. See .NET for Metro style apps overview for more details.

    Best Wishes!


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey. Thanks<br/> MSDN Community Support<br/> <br/> Please remember to &quot;Mark as Answer&quot; the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Friday, May 02, 2014 6:38 AM
  • The ApplicationException documentation does not list .Net For Windows Store apps in its supported Versions section. Classes and methods that are available will say so in the Versions section and will be marked with a green shopping bag icon. You can also use the Object Browser in Visual Studio to list just the classes which apply to your solution.

    See these snips from the ArgumentException class which indicate that they are supported:

    Also note the remarks in the ApplicationException page which recommend using Exception directly rather than ApplicationException.

    Friday, May 02, 2014 7:29 AM
    Owner