Click here to Skip to main content
15,040,212 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi there,

Can anyone give soem advice on how to add html help files to VS 2010 app.
Posted

Go to the line before the declaration of a type or its member. This is intended for public members and types. Type "//" in C# code ("" in VB.NET) — Visual Studio will create a comment template for you. Fill it in and build the project.

The build will create XML document file. By default, it will happen only for the configuration "Debug". You can test it: reference your assembly by another one and click on the Solution Explorer node where you referenced assembly is added. You will browse reflected code of your assembly showing help information.

[EDIT after clarification by OP]

If you need existing HTML file, add it to your project's directory structure the was you would add any other file, via Solution Explorer, "Add…" => "Existing Item…". It needs to be copied to your output directory. The file generated by build will be placed at the same position in output directory structure as your source help file relative to your project's *.*proj file (try it to see). You only need to specify that the file should be copied. Go to Solution Explorer node of the added file and activate Properties. Make sure you use the following properties "Build Action: None", "Copy to Output Directory: Copy if newer" or "Copy to Output Directory: Copy always".

There is another way: to embed any file in your assembly's executable module. To do that you need to add the file to .RES resource. In this case it will be added with "Copy to Output Directory: do not copy"; you would not need to change anything in properties after you added the file. You can used resource during run time as it content will be available for you through resource as as string; also, you can use resource URI for it.

—SA
   
v2
Comments
AnnSJ 23-Jun-11 4:41am
   
Thanks.
But i do not want to generate help files from the code comments.
What we have is kind of user manual and it is already in html format.

i need to know how to add this html file to the application.
Hi all,
Maybe i wasnt very clear abt my question..
Anyway i found teh solution.. thought i would let ppl know in case they have a similar query

1. Add the help document ( html / docx ) to the project. Right CLick -> Add existing Item - > Browse to the location of file - > add
2. Add a Helpprovider from the toolbox into the form(name - HelpProvider1)
3. Set the namespace property of the HelpProvider1 to the loaction of the help file in your project folder.
4. In case you have a Help menu item. Add thsi code to the click event of the menu item - Help.ShowHelp(Me, HelpProvider1.HelpNamespace)

Thanks.
Ann
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900