Framework goto definition shows comments, are these generated from xml comments? - visual-studio

I was mildly surprised recently to discover that my carefully crafted xml comments weren't showing up in intellisense for my colleagues. Having always used the associated assemblies with project references, I hadn't realised that you had to export the .xml document as well to access this information.
This led me to wondering how the .Net framework intellisense works. If I understand correctly, the .xml files must be hidden away somewhere in a special folder?
But my main question is about 'Goto definition' - if you goto definition on a .Net framework assembly, you get the info generated from metadata - but also with plenty of helpful comments - are these magically generated from Xml comments, or did someone have to write a macro + to convert them just for the build? Putting it differently: how can I get this effect for my assemblies?

Are your projects configured to generate the XML documentation? Just because you add the comments to the source code, the compiler won't generate the .xml file unless it's told to.
In the project properties page, go to the "Build" tab and look at the "Output" section. You should see a checkbox entry titled "XML documentation file". If textbox following that checkbox is empty you aren't generating the XML documentation file.
Once you get the XML documentation file generated, you should see your comments in the IntelliSense tooltips. If you include references to other projects as a project reference this should happen automatically. If you include references to assemblies, you need to ensure that the xml file is in the same location as the referenced assembly. (When you build, you should get xml files for all of the assemblies that have them in the bin/debug or bin/release folder respectively.)
For the .NET Framework assemblies themselves, the corresponding xml documentation files are installed as part of the Framework. For .NET 2.0, 3.0, or 3.5 the documentation files are located at C:\Windows\Microsoft.NET\Framework\v2.0.50727\en (assuming a default installation of the Framework). These files are used by both the IntelliSense tooltips and the "Go to Definition" functionality in Visual Studio in order to display this information. There is not any special processing that takes place or macros run in order to make this happen. The only information Visual Studio most likely uses is a combination of registry keys to determine the correct path to the documentation files.
While you probably could locate the xml documentation files for your own assemblies in the same folder, I would recommend against doing so as you then pollute the Framework installation with non-Framework related files.

Related

Where can I find the complete schemas for Visual Studio 2005 and 2008 project files?

The only thing I could find so far were those two pages
http://msdn.microsoft.com/en-US/library/y4sy8216(v=vs.80).aspx
http://msdn.microsoft.com/en-US/library/y4sy8216(v=vs.90).aspx
Along with the respective "descriptions".
However, they are far from complete as is evidenced by the missing descriptions for elements underneath the Tool element.
So then I found the descriptions for VCProjectEngine in the VS installation folder:
C:\Program Files (x86)\Microsoft Visual Studio 8\Common7\IDE\PublicAssemblies\Microsoft.VisualStudio.VCProjectEngine.xml
but it's unclear whether the names of the object properties is a 1:1 mapping to those inside the resulting .vcproj file?
Things appear to be a little more straightforward for newer VS versions (MSBuild based), but not completely.
There are none that describe the whole project file. The thing is that many tags work by convention, many tasks can be declared and named inline by simply calling out to the task assembly.
So even though for the basic structure a XSD exists, there is none that describes every possible way a project file can be setup not can you validate the project file without loading the tasks and have them validate their own snippets.

VS2010 VC++ Setup Project misses language dll

I have created a Setup Project in VS2010 for my VC++ project and I have it generating a setup file and it includes Primary Output, Content Files, Documentation files and Resource Sattelite DLLs from my VC++ project. My VC++ project is multilanguage and hence includes language DLL files in subdirectories. My issue is that the Setup Project does not include these language DLLs (nor their directories into which they must be placed).
I would have thought that these DLLs were included in the Project Output but they are not. :-/
I know I could add them manually by referencing the files directly, but that means including a absolute reference which I would rather not do. Also, a fixed reference means Release/Debug versions of the file are not handled (only one of them is use regardless of project setting).
Suggestions?
Edit: I have now tried Setup Project, InstallShield LE and WiX. None of them include the localization dll's into the setup project (only managed a working setup with Setup Project, but could see that the other installers did not include the required dll). I can't even fint any reference to this being a know bug and I have really tried hard to find a solution to this.
Found it over there:
C# Creating a setup for multi-language
It worked. I hope it is what you were searching for.

Using a DLL I've created in another VS2010 project doesn't show the intellisense tooltips

I've created a DLL to a project in Visual Studio 2010.
I'm using this DLL in another project. Using the functions is completely possible - but I can't see any tooltip.
In addition - if I'm in the same project the tooltips can be seen.
I've read some issues about using the XML file with the name of the DLL in the 2nd project, but I'm afraid I don't have any XML file (as far as I see...).
I'll appreciate your help!
Lior
In the project settings of your DLL you can specify that a XML file will be created each time the assembly is build. Thi setting is located on the "Build" tab, region "Output" and is called "XML documentation file". Mark the checkbox in front and the xml file will be created.
When you use the dll in another project you have to copy the xml file along with the assembly file to have the IntelliSense information in place.

"Add Service Reference..." to xsd

I can create a service reference in Visual Studio 2010 to an xsd. That reference downloads all the linked xsd files. However, I have 2 problems I'd like to see if there are solutions:
The URL for each xsd actually ends in .gx (e.g., http://mycompany.com/Schema1.gx). When Visual Studio imports the files, it renames them to .xsd, but in the xsd:import node, it keeps the original reference name with .gx, so my reference, once it's in Visual Studio is "not found or invalid"
for some of the xsd:import statements, the path to the referred-to .gx file is in another directory (e.g., schemaLocation="subDirectory1/Schema1.gx"). However, when they're imported, all xsd files are in the same directory in Visual Studio, but again, the xsd:import node is not modified to reflect the flatter structure.
Is there a solution to import these xsds in a valid way?
It is most likely a bug - the svcutil doesn't "refactor" the schemas. If you want a tool that handles this kind of work and more like it, this XML Schema refactoring tool should help. Download, install and create a new XML Schema Refactoring file (.xsr); add a new XML Schema collection; right click on the version 1.0, select [Import Schema Files...] command and follow the prompts. It can "slurp" online schemas, including ones referenced from, or embedded into, WSDL files, etc.

How to add satellite assemblies to a project in Visual Studio

I'm working in a project which references assemblies from a third company. These assemblies have satellite assemblies that I'm copying with a post-build event to the bin folder.
Is There a way to include those third party satellite assemblies into the project so I have not to care with the post-build events and maintaining the files?
Thanks in advance.
MORE INFORMATION: As the references have only resources they are not added as project references, actually I'm just copying them to the // folder. As each localized reference has the same name I would only be able to add it one time to the project's references.
It is automatic in the C# IDE. Setting Copy Local = True on the assembly reference ensures that the satellite assemblies get copied as well. In the C++ IDE it is a setting: Framework + References, Build properties category, "Copy Local Satellite Assemblies".
There's not enough info in your question to narrow down which IDE you use or why it wouldn't work for you. Maybe that 3rd party is doing something non-standard. Give them a call.
I was researching a related problem and stumbled on this thread. Please note that referencing the satellite assemblies directly (via the 'add reference' dialog) is not the way to incorporate them into your application. In stead just make sure they are located in a folder hierarchy as suggested above (relative to the original location of the binary file they contain resources for).
The only file you add a reference to explicitly is the library itself. Do remember to set 'copy local' to true in the property window of the reference. The runtime will then make sure to pull resources from the file whose directory matches the system locale.
In the references, right click and select properties on your reference to the third party assembly.
Ensure that "copy local" is true.
If this is true, then it should copy the satellite assemblies, as this is the behavior I've experienced in Visual Studio.

Resources