tags:

views:

54

answers:

3

This is in reference to a problem I had which I was able to find the solution to here on SO.

This wasn't my question, but it was the same exact problem I had. How do I know that I need to import a specific DLL to use a specific namespace? I saw no reference to this on either the MSDN page or the Object Explorer, and even Resharper didn't pick up on it. Is this referenced anywhere?

+3  A: 

From http://msdn.microsoft.com/en-us/library/system.runtime.serialization.json.datacontractjsonserializer.aspx:

DataContractJsonSerializer Class

Serializes objects to the JavaScript Object Notation (JSON) and deserializes JSON data to objects. This class cannot be inherited.

Namespace: System.Runtime.Serialization.Json
Assembly: System.ServiceModel.Web (in System.ServiceModel.Web.dll)

John Saunders
Hmm, guess I'm blind. Thanks. Still wish there was an in-IDE solution though.
ryeguy
Just bring up the Help in the IDE.
John Saunders
If you open the object browser, search the type and it comes up, you can right click it, and choose "Go to definition". Then work back to the top level for the class to find the assembly it is defined in.
Matthew Scharley
Yeah, I almost added that comment. Problem is he doesn't have the assembly referenced, so info on the type won't be there.
John Saunders
Depends where it is referenced... I find there's a whole bunch of assemblies in the object browser that I don't reference directly (perhaps they are dependencies of what I have referenced, I don't know). MSDN will always know though.
Matthew Scharley
A: 

Good question. I generally do a quick search for the class on Google, then start typing for the assembly based on the beginning of the namespace it's in.

Chris Stewart
That doesn't work for many newer types.
John Saunders
A: 

When you look up the namespace on MSDN, most classes specify the assembly where it resides.

In reference to your previous question: MSDN Reference

Near the top you get your answer:

Namespace:  System.Runtime.Serialization.Json
Assembly:  System.ServiceModel.Web (in System.ServiceModel.Web.dll)
Will Eddins