When I use external library like Spring.Net, NUnit, NLog and etc. I don't see documentation for public methods (intelisense). How can I fix it?
You need the .xml file that contains the IntelliSense info for the assembly. Make sure it is stored in the same directory as the reference assembly for these libraries, it has the same name as the assembly but with the .xml filename extension. Maybe you forgot to copy it or cleaned-up too aggressively?
Related
I just discovered a misterious file in my (new) Visual Studio 2012 C++/CLI project: app.aps.
I can find no reference on the internet about it. What is it meant for? Can I safely delete it? It seems so. Should I ignore or include in my commits to source version control?
It's a generated file for designer efficiency, you can ignore it in source control:
File created by Microsoft Visual C++, a software development application; stores the binary representation of a resource included with the project; enables the application to load resources more quickly.
http://fileinfo.com/extension/aps
APS files are the binary versions of resource files. As resource editor does not directly read the .rc and resource.h files, the resource compiler turns them into the APS file.
Reference - Files Affected by Resource Editing
I'm new to Visual Studio and Windows, trying to figure out how to include a 3rd party lib into my vb.net project. I'm using VS2010 "free edition", i've added the required DLL file: Ionic.Zlib.dll and can see it under the references recent tab. The type "ZipFile" is still not resolving but should be according to the readme. Is there something else I need to do to make VS aware of the DLL?
You also need to add a Imports statement at the top of the source file in order to be able to use a type without declaring the fully qualified name.
you need to write on the top of the file
in c#:
using Your_namespace;
in vb:
imports Your_namespace
I have created an extension for VS 2010 that deploys a project template. The project template uses a custom wizard (in a specific assembly) that is called when I create a new project based on this template.
I want to package the assembly containing the wizard within the VSIX, so that it gets deployed somewhere the template can find it (I know GAC is not an option with VSIX).
Basically if I deploy the assembly to the GAC, install the VSIX and then create the project the wizard is invoked successfully.
If I do the same without deploying the assembly first, the project templates does not find the assembly when I create the project.
My question is: how to deploy a project template and the assembly it needs using a VSIX package?
Thank you for your help
EDIT: I changed the VSIX Sub Path of the wizard assembly reference to "ProjectTemplates" in both the installer project and updated the vsixmanifest content assembly reference accordingly. It seems to work now.
You don't need to get your assembly containing the IWizard implementation in the GAC. You can simply declare it in your extension.vsixmanifest file as an Assembly element in the Content section.
Unfortunately, this doesn't appear to be documented well anywhere.
The only tricky part is making sure that the AssemblyName attribute has the correct value.
I had no luck with the Assembly element technique to work, so in case anyone else runs into the same problem, here's another solution.
Visual Studio looks for wizard DLLs using the BindingPaths registry key. If you add the folder containing your DLL in a subkey of BindingPaths, then Visual Studio will find your DLL.
To do this from a VSIX, create a .pkgdef file in your VSIX project. Set its Include in VSIX property to True, and paste the following text into it:
[$RootKey$\BindingPaths\{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}]
"$PackageFolder$"=""
(where the Xs represent the package GUID, though I suspect any GUID will do).
This works for me:
[$RootKey$\BindingPaths\{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}]
"$PackageFolder$"=""
But assembly element doesn't work.
I have a DLL file. How can I view the functions in that DLL?
For native code it's probably best to use Dependency Walker. It also possible to use dumpbin command line utility that comes with Visual Studio.
Use the free DLL Export Viewer, it is very easy to use.
You may try the Object Browser in Visual Studio.
Select Edit Custom Component Set. From there, you can choose from a variety of .NET, COM or project libraries or just import external DLLs via Browse.
Use dumpbin command-line.
dumpbin /IMPORTS <path-to-file> should provide the function imported into that DLL.
dumpbin /EXPORTS <path-to-file> should provide the functions it exports.
For .NET DLLs you can use ildasm
Use dotPeek by JetBrains.
https://www.jetbrains.com/decompiler/
dotPeek is a free tool based on ReSharper. It can reliably decompile
any .NET assembly into C# or IL code.
Without telling us what language this DLL/assembly is from, we can only guess.
So how about .NET Reflector.
If a DLL is written in one of the .NET languages and if you only want to view what functions, there is a reference to this DLL in the project.
Then doubleclick the DLL in the references folder and then you will see what functions it has in the OBJECT EXPLORER window.
If you would like to view the source code of that DLL file you can use a decompiler application such as .NET reflector.
For non .NET dlls, installing binutils on a Linux system presents the objdump command that can be used to display information of a dll.
objdump --private-headers <file.dll>
Look for the Export Address Table section in the output.
.NET ildasm
ildasm helped and even dumped methods body, but to edit .DLL you also need any hex editor.
ildasm example to fix Help Viewer v2.x issue:
error: "An error occurred while updating content: File '???.cab' was not signed by Microsoft"
here could be image
more example files
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.