I lost the solution of a class library. Can I open the DLL file which is created by the class library?
-
2possible duplicate of [Opening and snooping DLLs](http://stackoverflow.com/questions/3020345/opening-and-snooping-dlls) – Daniel Powell Aug 05 '13 at 04:50
8 Answers
You are better off with a decompiler like Redgate's .NET Reflector or JetBrains' ReSharper decompiler.
There are open source ones also, like:

- 30,738
- 21
- 105
- 131

- 14,748
- 25
- 102
- 188
Follow the below steps...
- Go to the Start Menu.
- Type Visual Studio Tool.
- Go to the folder above.
- Click on "Developer Command Prompt for VS 2013" in the case of Visual Studio 2013 or just "Visual Studio Command Prompt " in case of Visual Studio 2010.
- After the command prompt loaded to the screen, type
ILDASM.EXE
press ENTER. - An ILDASM window will open. Drag the
.dll
file to the window from your folder. Or click on menu File → New. Then add the required.dll
file. - After the above steps, the manifest and
.dll
file will appear. Double click on those files to see what they contain.

- 30,738
- 21
- 105
- 131

- 785
- 1
- 10
- 19
-
1I followed your clear instructions using VS 2012 and 2015 / Windows 7 Pro. However, ILDASM issued the following message for the .dll file I attempted to examine: `has no valid CLR header and cannot be disassembled`. – CODE-REaD Sep 15 '16 at 16:04
-
4This process is used to disassembled Intermediate Language generated by CLR. – mmushtaq Oct 31 '16 at 04:54
I think you have downloaded the .NET Reflector & this FileGenerator plugin http://filegenreflector.codeplex.com/ , If you do,
Open up the Reflector.exe,
Go to View and click Add-Ins,
In the Add-Ins window click Add...,
Then find the dll you have downloaded
FileGenerator.dll (witch came wth the FileGenerator plugin),
Then close the Add-Ins window.
Go to File and click Open and choose the dll that you want to decompile,
After you have opend it, it will appear in the tree view,
Go to Tools and click Generate Files(Crtl+Shift+G),
select the output directory and select appropriate settings as your wish, Click generate files.
OR
You cannot get the exact code, but you can get a decompiled version of it.
The most popular (and best) tool is Reflector, but there are also other .NET decompilers (such as Dis#).
You can also decompile the CIL using ILDASM, which comes bundled with the .NET Framework SDK tools.

- 30,738
- 21
- 105
- 131

- 10,056
- 7
- 50
- 82
I use JetBrains' dotPeek software. You can try that too.

- 30,738
- 21
- 105
- 131

- 51
- 1
- 1
Telerik's Just Decompile is the best I've used. It's free once you sign up with an email.

- 30,738
- 21
- 105
- 131

- 7,930
- 17
- 96
- 128
Open the .dll file with Visual Studio. Or a resource editor.

- 30,738
- 21
- 105
- 131

- 5,221
- 4
- 46
- 81
-
2When I attempted to open a .dll file using Visual Studio Express 2013/Windows 7 Pro, it issued the following message: `There is no editor available for (file I tried to open). Make sure the application for the file type (.dll) is installed.` – CODE-REaD Sep 15 '16 at 16:06
*.dll files are archive files opened with WinZip, 7-Zip, etc. That isn’t to say that all .dll files are archives. You can save anything with the .dll extension. However, most Windows .dll files are generated to be archives. Examples of this are Windows > twain_32.dll which is an archive file. However, twain.dll is not. If you look at twain.dll you will see an MZŽ as the first three notepad characters which denotes a compiled C file/program or part of a program. Whereas MZ seems to be an archive.
Also, most .exe files are archives mostly containing an icon image, etc. For the file and the windows installer packages as well, they contain all the information the program needs to run images, movies, etc. and also directories including installation information and plain text files.
I have a game here, game.exe, and it contains Java class files and image a pointer directing the .exe to run a .bat file. Obviously, your .bat file will run a javac call from the archive and run the game. There are also a few .dll archives containing Java class files.
[autorun]
ICON=AUTORUN\MINCRAFTLOGO.ICO
standard icon redirect here .ico is an image file within a .dll file within a .exe file. So the image seen on the .exe file is the minecraft logo. This is in a file called autorun.inf. Second example
[discstarter]
startpage=Autostart\Disk1.html
uselanguagestartpage=1
windowcaption=Solid Edge
licensee=Siemens PLM Software
productguid=05B227DF-DB00-4934-B3C8-40B7D8FAA54A
singleinstance=1
hidesplashscreen=1
noscrollbars=0
showstatusbar=1
splashscreentime=0
windowwidth=750
windowheight=775
buttondir=Autostart
toolbarcolor=16777215
toolbar=goback,goforward,gohome,print,exit
[autorun]
open=autostart.exe
icon=Autostart\ENGINE.ICO
This is the solid edge autorun.inf file contained in solidedge.exe Autostart\ is the Autostart.dll directory. open=autostart.exe specifies the autostart.exe file to run from within the original solidedge.exe archive. Here is a sample program using the .dll (dynamic link library) files: Creating And Using DLLs.
It also shows how they are created. As you can see, the contents of the DLL file file is called by an EXE file file as I previously explained. Also there is a tutorial here Walkthrough: Create and use your own Dynamic Link Library (C++), and, as I said before, 7-Zip or WinZip will open a dynamic link library as an archive as long as you have the .dll file. If the contents of the dynamic link library have been compiled obviously, you need a program which can read the file.
However, since .dll files are by definition just archive library files, the DLL file itself should be readable and not a compiled C or C# file, etc., etc. Basically, .dll files are archives. Well, they should be when a .dll file is created in Visual Studio. The DLL file is created and any information you store in the DLL file file is encrypted. Mostly, this encryption is handled by Visual Studio itself and generally isn't edited by hand. When you read a .dll file contents as a .exe, the contents are automatically decrypted. Now when we talk about compiling a program we are changing the contents into bytecode the machine easily interprets.
This file size would be smaller than the original file of the same contents. However, the filesize is larger, suggesting that the file has actually been encrypted. It is probably to stop people reading their code. As a result, the reading of .dll contents is termed decryption and not decompilation. Decompilation would convert the already-compiled .txt files to unreadable byte code. The use of standard .dll files is by definition not open source, because it involves the deliberate obfuscation of byte code.

- 30,738
- 21
- 105
- 131

- 1
- 1
-
13I'm not sure whether this would count as apostasy or heresy in computing circles. How could it be improved? If it was on paper, I could use a match to put it out of its misery. – brewmanz Oct 13 '16 at 09:13
-
-
It is incomprehensible near *"and image a pointer directing"*? – Peter Mortensen Jul 12 '22 at 13:06
-
OK, the OP has left the building: *"Unregistered ... Last seen more than 8 years ago"* – Peter Mortensen Jul 12 '22 at 13:07