why don't my comments work?

S

suzy

Hi,

I am wondering why my comments do not appear in intellisense.

I have written the following method:

/// <summary>
/// testing
/// </summary>
/// <param name="stem">will this work?</param>
public void test(string stem)
{

}

If I compile/build this code, and try to call it, the summary doesn't appear
in the intellisense. Any idea why?

Thanks very much.
 
P

Philip Rieck

Verify that you are moving the XML file created along with your assembly (if
you are copying myassembly.dll to where you're referencing it, make sure
you've also copied myassembly.xml )
 
J

Jon Skeet [C# MVP]

suzy said:
I am wondering why my comments do not appear in intellisense.

I have written the following method:

/// <summary>
/// testing
/// </summary>
/// <param name="stem">will this work?</param>
public void test(string stem)
{

}

If I compile/build this code, and try to call it, the summary doesn't appear
in the intellisense. Any idea why?

Do you mean you're using it from a different solution? If so, you need
to build the XML documentation file and keep that with the assembly.
 
S

suzy

The XML file that is generated is in the bin\Debug folder.

I haven't moved the assembly anywhere, I am trying to get it working in
design time. Still no joy. :(

I am a newbie by the way. :)
 
S

suzy

OK I must be really missing something here.

Jon,

yes you are right, i am accessing this code from another solution. I tried
creating a documentation file (which created lots of html files etc in a
folder called "CodeCommentReport". There is no xml file here though).

I have also tried copying the doc.xml file that was created when I build the
solution into the same dir as my code files and that didn't work either.

What do I do from here, because it's still now working.
 
J

Jon Skeet [C# MVP]

suzy said:
yes you are right, i am accessing this code from another solution. I tried
creating a documentation file (which created lots of html files etc in a
folder called "CodeCommentReport". There is no xml file here though).

Nope, you don't want to do that. Intellisense is looking for the XML
file, not HTML.
I have also tried copying the doc.xml file that was created when I build the
solution into the same dir as my code files and that didn't work either.

What do I do from here, because it's still now working.

You should name the XML file the same as your assembly, but with .xml
on the end instead of .dll. For instance:

MyCompany.Foo.dll and MyCompany.Foo.xml

If they're both in the same directory with the naming scheme above,
VS.NET should pick them up.
 
H

Hans Kesting

suzy said:
OK I must be really missing something here.

Jon,

yes you are right, i am accessing this code from another solution. I tried
creating a documentation file (which created lots of html files etc in a
folder called "CodeCommentReport". There is no xml file here though).

I have also tried copying the doc.xml file that was created when I build the
solution into the same dir as my code files and that didn't work either.

What do I do from here, because it's still now working.

Just to go over the steps, these work for us:
1) in the project properties, write a filename for XML documentation
(Configuration Properties | Build)
the default name seems to be: same directory/filename as dll,
except a ".xml" extension instead of ".dll"
2) REbuild the project to generate/update this XML file,
no need to generate the documentation html-files.
(If you just "build" the project then the xml-file is not updated.)
3) reference this dll in the other project, xml (and pdb) files
are automatically copied


Hans Kesting
 
H

Hans Kesting

One final point:

After you have changed & recompiled your library project/solution,
you need to recompile the project (solution) you are using it in, so the
new dll + xml are picked up.

Hans Kesting
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top