2

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

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 file 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?

Community
  • 1
  • 1
ryeguy
  • 65,519
  • 58
  • 198
  • 260
  • Type the exact name of the class on google.com/bing.com and you'll get the link to the article guiding you to the assembly you require :) – Kirtan Jul 22 '09 at 14:02
  • Ideally, as John rightly said, it's on MSDN where you can find out details about the assembly, so just include MSDN as a keyword - for e.g. DataContractJsonSerializer msdn. – Kirtan Jul 22 '09 at 14:03

3 Answers3

3

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)

Community
  • 1
  • 1
John Saunders
  • 160,644
  • 26
  • 247
  • 397
  • Hmm, guess I'm blind. Thanks. Still wish there was an in-IDE solution though. – ryeguy Jul 22 '09 at 14:02
  • Just bring up the Help in the IDE. – John Saunders Jul 22 '09 at 14:04
  • 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 Jul 22 '09 at 14:04
  • 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 Jul 22 '09 at 14:08
  • 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 Jul 22 '09 at 14:10
0

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
  • 3,303
  • 9
  • 36
  • 55
0

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
  • 13,628
  • 5
  • 51
  • 85