Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I have developed a number of internal REST interfaces using the older WCF framework in VS 2010. The ability for it to generate help pages was handy for DEV and QA platforms, but for a production release it was easy to disable the generation of these help pages in the web.config file:

<standardEndpoint name="" helpEnabled="false" automaticFormatSelectionEnabled="true"/>

I am now moving on to use the WebAPI framework instead (currently version 1 on VS 2012), but it doesn't appear to be as trivial to turn this feature off (i.e. I can't find any information on how to do this in a web.config file).

Certainly I can go ahead and do this by hand within the code itself, but surely there's an easier way; something akin to how WCF did it as described above. I'd like to use the web.config file approach since I already have the web.release.config transform files in place for other settings.

Any thoughts on best practices on this would be appreciated.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
276 views
Welcome To Ask or Share your Answers For Others

1 Answer

Open the Global.asax.cs,modify your code like the following snippet code:

#if DEBUG
   AreaRegistration.RegisterAllAreas();
#endif

Because the help page is in the Area named 'HelpPage',so we can ignore it by the above code in the release or production environment.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...