How to edit C# code in a .net DLL [duplicate] - c#

This question already has answers here:
Edit .NET assembly and recompile
(3 answers)
Closed 7 years ago.
I have used many decompilers but have too little experience to understand where it is that I can edit the c# code of specific objects within the DLL. Is it possible to simply edit the C# code and save the changes? If so how could I go about doing this?
TL:DR
How do I edit C# code inside a DLL that I do not have the source code for?

You can edit & patch .NET DLL/EXE with https://github.com/0xd4d/dnSpy
Worked perfectly well for me.

Related

How do I edit a c# dll [duplicate]

This question already has an answer here:
Dotpeek recompile decompiled files
(1 answer)
Closed 6 years ago.
I have a c# project that includes a dll which I need to make changes to. So I decompiled it using dotpeek, exported the code and made my changes. Now I need to recompile it to add it back to my project.
The issue is that I am not sure if I am going about this problem the right way. And if I was how would I recompile the code into a dll again?
Sorry about this question but I am new to c# and visual studio but thank you for your help!
You will need to create a new C# project in visual studio, put the decompiled code in the new project and then you can convert the modified decompiled code back to dll which can be referenced in your project.

How can I make the published code of EXE as readable in C# asp.net. Is there a way? [duplicate]

This question already has answers here:
How do I decompile a .NET EXE into readable C# source code?
(9 answers)
Closed 6 years ago.
I lost the original source code of my .exe. Now I want to edit some more changes. Is there is any way to make the published code of .exe as readable in C# asp.net?
Reflector and its add in FileDisassembler
Reflector will show the source code and FileDisassembler will convert it into Visual Studio Solution.
Please check out this link.
And for more knowledge you can check this link as well.

Importing a module in .NET and then using it as an object? [duplicate]

This question already has answers here:
How can I call (Iron)Python code from a C# app?
(3 answers)
Closed 9 years ago.
I have a Python module, and I'd like to be able to import parts of it like classes in C#, accessing its methods and such as .NET native as possible.
How can I accomplish this using IronPython?
Take a look at this: https://wiki.python.org/moin/IntegratingPythonWithOtherLanguages
You can assemble Python modules as dynamic-link libraries and then pinvoke them in any .NET application. You can find more details here: http://msdn.microsoft.com/en-us/library/aa719104(v=vs.71).aspx

Visual C# to Visual C++ [duplicate]

This question already has answers here:
How to use c# Dll in vc++?
(3 answers)
Closed 9 years ago.
I need to use dlls, headers and functions from a Visual C# project in a Visual C++ project.
I tried to add the dlls via "Add References" but I keep getting this error...
Caching metadata information for e:\linha_3_os179\indutron_opc\treiberdlls\elabo.devices.g_series.deviceplugin.dll
Any suggetions?
Thanks!
I would try to expose the c# code as COM objects and then use COM from c to call them

Creating a 32 Bit DLL using C# or Java [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
Converting .NET App to x86 native code
is there a way to create a standard (not .NET Assembly type) 32Bit DLL for Windows using C# or Java?
And for WinCE ??
Thank you
This was referenced in one of the comments, but I wanted to post it as an answer:
For C#:
https://stackoverflow.com/a/1779505/490561
Basically, the idea is to use Mono and then Ahead Of Time Compilation. I think that'd do the trick.
For Java, the idea is similar:
https://stackoverflow.com/a/2011727/490561

Categories