2

This question is on behalf of one of my team members: I am a developer in charge of writing the documentation for our product. I have written a tool in C# to output our assembly in markdown style files. In order to facilitate the ease of use for our classes, I wanted to implement a way of linking the class type and property constructs to any MSDN documentation available publicly. For the most part, this was accomplished simply by using the namespace of the class like so:

msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.webcontrol(v=vs.110).aspx

However, I ran into some problems when looking at classes with generic type arguments and properties. They seem to be generated in a special manner that looks like a hashed string, like so:

msdn.microsoft.com/en-us/library/b682ts2x(v=vs.110).aspx

The “b682ts2x” part of the URL is the part that is different.

I would like to know if there is any way I can get in touch with someone who knows how these links are generated, and if there is a way to generate the same exact URL portion (that is, b682ts2x) for any class property using only reflection.

1 Answers1

0

As an alternative approach you could use the same syntax that the F1 help is using when you highlight a class name for example.

As mentioned in Visual Studio intercepting F1 help command

msdn.microsoft.com/query/dev11.query? appId=Dev11IDEF1& l=EN-US& k=k(width); k(vs.csseditor); k(TargetFrameworkMoniker-.NETFramework,Version%3Dv4.0); k(DevLang-CSS)& rd=true

The "k" parameter above is contains the help context inside visual studio. Help context contains both "keywords" (text strings) and "attributes" (name/value pairs) which various windows inside Visual Studio use to tell the IDE about what the user is doing right now.

For example here is one for System.Net.HttpHttpClient.

https://msdn.microsoft.com/query/dev12.query?appId=Dev12IDEF1&l=EN-US&k=k(System.Net.Http.HttpClient);k(TargetFrameworkMoniker-.NETFramework,Version%3Dv4.5);k(DevLang-csharp)&rd=true

Notably when I pressed F1 when highlighting "HttpClient" it assumed I meant ServiceClient.HttpClient so be careful to provide the namespace.

Community
  • 1
  • 1
Alex KeySmith
  • 16,657
  • 11
  • 74
  • 152