Ronnie W
Ronnie W

Reputation: 113

How can I know which assembly contains a given namespace? - C#

I am trying to do toast notifications in windows 10 in a WPF application. All the examples I see refer to a namespace

using Windows.UI.Notifications;

The only problem is that none of the examples I have seen explain what assembly contains that namespace and defines the classes I need.

In particular, I am looking for the ToastNotificationManager class.

In this case(or in general) how can I tell which assembly contains a given namespace?

Upvotes: 3

Views: 1721

Answers (3)

David Anderson
David Anderson

Reputation: 13670

You can use the Visual Studio Object Browser to identify assemblies containing namespaces by making sure you have View Containers selected instead of View Namespaces. Then, you can do a search for your namespace Windows.UI.Notifications.

enter image description here

From what I can tell, it is part of Windows Runtime in version 1.3, so it should already be available to your Windows Runtime application. I'm not sure if this is something that is part of the .NET BCL, which is why you might not be finding a specific assembly. Here is a great Msdn article on toast notifications as well.

You didn't specify what type of application you are building, but here is the article for doing this from HTML, and since that is possible, that means it is able to be done via COM in a non-Windows Runtime .NET application, or from another language even.

Upvotes: 0

filhit
filhit

Reputation: 2154

For some assemblies made by Microsoft, you can search http://referencesource.microsoft.com/ (It is an amazing source for learning by the way). It will show the assembly in the tree.

Otherwise you should search the documentation and hope the author has put the assembly name there (MSDN documentation generally contains the assembly name).

Upvotes: 0

TomTom
TomTom

Reputation: 62093

You can not. Namespaces and assemblyx name have no correlaction. If you need to know which assembly - the documentation for a CLASS normally has that at the end.

Otherwise, you are free to put any class into any namespace regardless of assembly name.

Upvotes: 1

Related Questions