Transform *.dll to *.cs [duplicate] - c#

This question already has answers here:
How do I decompile a .NET EXE into readable C# source code?
(9 answers)
Closed 7 years ago.
I have a dll file that I want to decompile. I know there are ILSpy, dotPeek and similar programs, but I have yet to find one that will actually create the cs file.
The dll I'm dealing with has several hundred classes in it and it would take days to manually copy everything.
Is there a tool that will take a dll file and return a set of cs files?

ILSpy
If you have loaded a dll in ILSpy, select File -> Save Code... or type Ctrl + S.
If you select the dll in the tree, then it will create a cs
project in a selected folder, along with C# files for each
class.
If you select just a class in the tree, it will create just
the C# file for the class.
See ILSpy.

Related

Can I use python to run a C# script file(.cs)? [duplicate]

This question already has answers here:
How to call an external program in python and retrieve the output and return code?
(5 answers)
Closed 3 years ago.
I'm working with python on a project using OPT GIGE cameras. What I need now is to show the camera vision and capture a frame with my Python script. I didn't find anyway to connect to the gige camera with opencv in python, so I decide to use halcon to capture the image. But halcon can only export to .cs file I wonder is there anyway to use python to execute a .cs script?
It seems that you confused C# source code file and C# Script file.
The former has a .cs extension and is just a source code file, wich should be included in the project and compiled, and requires .NET Framework or other .NET runtime, depending on the OS version, to run.
The latter has a .csx extension and looks more like what you are looking for - however, it still requires .net libraries. More about .csx files can be found here and here

Is it possible to decomplie any exe to .net source code (Visual studio) [duplicate]

This question already has answers here:
How do I decompile a .NET EXE into readable C# source code?
(9 answers)
Closed 5 years ago.
I have an exe file which is written in .net language . I have no source code for same but I want to change some functionality in this so convert it to visual studio source code. is there any way to do this?
have a look on IL Spy-
https://www.gallery.expression.microsoft.com/8ef1d688-f80c-4380-8004-2ec7f814e7de
Also you can download it from here-
http://sourceforge.net/projects/sharpdevelop/files/ILSpy/2.0/ILSpy_Master_2.1.0.1603_RTW_Binaries.zip/download.
Just unzip the contents in a folder somewhere - no installer. Then run ILSpy.exe.

Merge two DLLs with project type "class library" [duplicate]

This question already has answers here:
How do I merge multiple .net assemblies into a single assembly?
(3 answers)
Closed 6 years ago.
My project is of type "Class library" and has a reference to "Newtonsoft.Json". I would like to have one single DLL as output so that other consumers only have to exchange one DLL. Right now, the project builds to two single DLLs.
I have set "Embed Interop Types" to "True" for "Newtonsoft.Json" which resulted in an error ("Cannot embed interop types because it is missing either the 'ImportedFromTypeLibAttribute' attribute or the 'PrimaryInteropAssemblyAttribute' attribute..").
I have also found many other posts regarding this problem, but most of these posts were about including DLLs in a .exe which I do not have.
How can I merge both DLLs?
Have you tried using an external tool like ILMerge (https://www.microsoft.com/en-us/download/details.aspx?displaylang=en&id=17630) ?

Can I retrieve source code from a compiled WPF application? [duplicate]

This question already has answers here:
How do I decompile a .NET EXE into readable C# source code?
(9 answers)
Closed 7 years ago.
I have been working on a project for my college course for a couple of months. When I went to submit it the other day the source code has gone missing. It was a WPF C# application. Because all of the work was done on my memory stick I have no backup of it.
I tried running a recovery tool but it was unable to find anything.
What I have is the following:
The contents of the bin > Debug folder including an up to date compiled version of the application (an exe file)
The .sln file for the project.
I really need the source code for this as without it I might end up failing the project. Is there any way to get it with what I have?
If you have DLLs you can use something like .netReflector and peep into code..
use dlls in a new project and then you can drill into them

Adding resources and setting Exe description [duplicate]

This question already has an answer here:
How can we add embedded resources to a file which is compiled from a source file at run-time
(1 answer)
Closed 9 years ago.
I am generating C# code at runtime and compiling it with the CSharpCodeProvider The two problems I'm having are
How to add resources to the generated exe?
How to set the executable description (i.e company name and others) to it?
Thanks.
Have a look here my friend. I think this will sort you out as the guy was having the very same issue:
How can we add embedded resources to a file which is compiled from a source file at run-time

Categories