Using Visual Studio 2013 and .NET I've created set of widgets which I want to use in external projects. Each class and method is well documented with the XML-style comments. For example:
///<summary>...</summary>
When I use already commented code within the same solution, the appearing prompt suggesting how to finish the line contains my remarks. Nevertheless, when I tried to generate a DLL file with the code and use it in the external project the comments were not available anymore. How can I document code to make these hints visible in other projects using the compiled DLL?
If you want to use Code Documentation when referencing dll you have to generate XML documentation. XML documentation has to be in same folder that .dll is in.
Related
I've just inherited a web application whose source has long been lost (originally written in 2010 and shelved). The application has a few .dll assemblies that related to the application itself e.g. "applicationCORE.dll", "applicationBI.dll", "applicationDATA.dll" and "application.dll"
I've seen this question and the suggested tool (Just Decompile) is brilliant and created a .sln and .csproj file for the first assembly that I decompiled. My question is how do I merge the various projects that would be created through decompiling with the compiled web application files (.aspx) also, how do I resolve the references in the .aspx files i.e. referencing the codebehind file that no longer exists e.g. "default.aspx" references "default.aspx.cs" while the decompiler creates a "default.cs" file. Is it safer to rename the .cs file or should I update the reference?
Finally, will each dll appear as a separate project within the solution?
I realise this may be perceived as a duplicate question however there doesn't appear to be a resource online that walks a developer through the process.
Following David's advice, I managed to get the application running from decompiled assemblies. Here's the process I followed to get it working
I had already decompiled the various assemblies into projects using a Reflector (on a trial).
I created a blank Web forms application in Visual Studio
I added the .aspx pages from the website to the project through visual studio
Then added the .cs files from the decompiled 'application.dll' project (since this is the website project within the solution. Some files had to be renamed to match the codebehind references in the `.aspx. files
Each additional project e.g. applicationCore.dll was then added to the solution
Each project's references needed to be updated and references to the newly added projects must be added to the startup project
Since the website was built so long ago, there were 1,000's of syntax errors. The easiest way to resolve them was to use Notepad++ and the Find and Replace. To be safe, I did this file-by-file by following the errors from Visual Studio rather than a batch find and replace
When trying to build I noticed errors where required assemblies were missing so I changed the build output directory of the sub-projects to the bin folder of the web project
I added the connection strings and settings from the original website's web.config. I did this line by line to make sure I didn't break anything and so that I could trace the result of each addition
Finally I had a successful build!
Additional Steps
There were also syntax errors which I assumed were due to the decompiling process. Some external references needed to be added and there were slight changes due to the age of the project e.g. asp:AjaxScriptControl changed to asp:ScriptControl (after adding the package using Nuget). I also had to install Crystal Reports for this application and will have to purchase a Telerik licence as there are UI components being used (although I'll see if I can use an open / native alternative as I work through the app).
I've logged in using credentials (I did have to set the correct start page) and tried a few basic CRUD operations. There are silly issues that have to be resolved e.g. the authentication doesn't work properly and there's no redirect if you access a protected page but these things are relatively minor compared to the issues I faced initially.
What I must say is each error was resolved using questions and answers from this site! This was all completed in just under 6 hours.
we have an application in production and the code is in Pre-Compiled form. The developer who developed that application left the company and we don't have any backup of source code. the only access we have is Pre Compiled code in the server. We need to fix the issues in the application now.
Is there any way to Decompile (extract to actual source code) the PreCompiled code ?
Open the DLLs in the .NET Reflector.
To update #xOn's answer:
Due to a recent source control disaster I had to recover my project from the DLLs. So sadly I'm knowledgable on the procedure:
Get .Net Reflector from here: http://www.red-gate.com/products/dotnet-development/reflector/
You do not seem to need FileDisassembler.
Either load your bins in Reflector or double click them.
Mind that the .Net framework might have not maintained your original project file structure. So if some of your ASPX pages shared the same basic class name in different .cs files (I.E. Inherits tag is the same, but CodeFile tag differs), you would not be able to simply "export source code".
Don't go blindly exporting source files. It won't work.
There will still be some work to be done before being able to just fire up the old build button. For example - DLLs can refer to property's getter/setters directly. You will have to fix that.
Good luck.
Start with:
http://www.red-gate.com/products/dotnet-development/reflector/
...plus:
http://www.denisbauer.com/NETTools/FileDisassembler.aspx
You'll have to recompile the latter to link it against v6.5 of reflector (the latest, as of this post.) It is a good add-on if you want to avoid having to copy and paste ever single class into files by hand. It will dump an entirely assembly as .cs files. I think it may even generate a csproj.
Both tools are free.
I had the similar issue and used Reflector to Decompile it. I got the source code, then changed the bit I wanted, and rebuild it. Then I copied that dll again to Production site. It started to reflect my changes. It was very easy and not at all difficult, maybe because Precompiled site had dlls for every page, and was updatable , so had only code-behind file in dll.
For reference: http://www.reflector.net/
When u install .net reflecter.its import in visual studio.
then you saw the .net reflector tools on menu bar.
Click on .net reflector >>Choose Asseblies (Dll file) to debug.
I found that dll can be just Read using the .NET Reflector tool but can't extract the Source Code. And also once the webforms are precompiled, we can't even get back the code behind files. All we can do is to debug and analyze the Code.
I have been working with a DLL which contains some classes, and one of the classes has some constants. I wrote Summary for every one of these constants and these summaries appears as "tooltips" when I want to use the constants inside the DLL.
However, when I access these constants from the main project which is referencing this DLL, I don't see any Summary in the tooltip.
Does anyone know a solution for this problem? Everything is declared with a public access modifier. But MVS2013 does not cache these Summaries.
To see the summaries outside of the project you need to build the XML documentation file. Go to the project settings and select the Build section. At the bottom you'll see the "Output" options, and there will be a checkbox for XML documentation file make sure it's checked (in both debug and release modes).
If you're deploying the assembly by hand to other projects you'll need to make sure you copy the documentation XML file as well.
I'm trying to use OpenBLAS in a c# project (more specifically I'm attempting to use it with Math.NET via MathNet.Numerics.Control.LinearAlgebraProvider). I've successfully created the files following https://github.com/xianyi/OpenBLAS/wiki/How-to-use-OpenBLAS-in-Microsoft-Visual-Studio.
Now I have a .lib and .dll file in a new directory (as per subsection Use OpenBLAS .dll library in Visual Studio), but I'm not sure where to go from here!
Does anyone know what I'm supposed to do from here? I cannot directly add the generated dll to my project, and from further reading it seems like I need to generate a new dll using Visual Studio.
Use the NativeWrappers solution file provided by MathNet.
Similar instructions for MKL and ACML are here:
http://mathnetnumerics.codeplex.com/wikipage?title=Native%20Providers&referringTitle=Documentation
I have written the c# comments of my function,and then i gave the dll file to my friends who need it,but when he use those functions ,he can't see the comments,how to solve this problem?
Ps: I can see the comments when i use it in my project;
Comments are ripped off the assembly, you'll have to generate the xml documentation for your project and give it to your friend. If both files (assembly and xml documentation) are in the same directory Visual Studio will use the documentation in IntelliSense.
(Xml documentation can't be embedded in assembly)
You need to build the XML documentation file for the project as well (tick the box in the Build part of the project properties) and give your friends that file as well as the DLL.
If they put the two files in the same directory, Visual Studio will pick up the documentation automatically and show it in IntelliSense etc.
Note that this will only pick up XML comments (the ones started with /// or /**), not regular comments.