I have developed a dll in C#.net. Can we decompile the same in VB.net. If yes, how to do that?
-
Short answer is YES..... You will have to try a few different de-compilers and compare to see which one is better for what you are tying to do. Usually there is not one better than the others as each one is good for different situations. – Jonathan Alfaro Mar 23 '20 at 20:40
5 Answers
Use a tool like Reflector to convert a compiled C# assembly (IL) into decompiled VB.NET source code (might lose some meaning with certain variable names). Another post mentions some free alternatives to Reflector.
Or convert the C# code using an online resource such as this one (1 code file at a time though).

- 295,962
- 43
- 465
- 541
-
@PramodhTS No, some C# **cannot** be decompiled into VB because there are some elements of C# that have no equivalent in VB. E.g. unsafe code, and iterators (`yield`). Although iterators will be added in the next release of VB – MarkJ Jan 23 '12 at 17:41

- 295,962
- 43
- 465
- 541

- 22,727
- 9
- 68
- 113
-
1Good alternatives yes but I don't believe either of those support decompilation to *VB.NET* which is what the OP specifically asked for – Matt Wilko Jan 23 '12 at 09:13
-
1Another free alternative is Just Decompile from Telerik: http://www.telerik.com/products/decompiler.aspx – bbqchickenrobot Jan 23 '12 at 09:25
Assuming you have the source, you can use sharpdevelop to convert whole solutions back and forth between c#.net and vb.net
The same group also developed a plugin for visual studio: Code Converter C# to/from VB.NET

- 4,692
- 1
- 41
- 44

- 3,488
- 3
- 32
- 27
-
Tried them all. SharpDevelop was by far the best solution, thanks Rob. Telerik's was a distant second. BTW, version 4.4 of SharpDevelop still has "Convert to VB" (http://community.sharpdevelop.net/blogs/mattward/articles/FeatureTourCodeConversion.aspx). Looks like v5 lost that feature. – Todd Main Nov 12 '18 at 22:53
Sometimes C# cannot be converted (or decompiled) into VB.Net because there are some elements of C# that have no equivalent in VB. E.g. iterators (yield
) and unsafe code. Furthermore some of the free converters fail badly even when there are direct equivalents.
Why do you want to do this anyway? It's probably easy to just use the C# DLL from VB.Net code: you can call it, you can inherit from it. "CLS compliance" will help with this.
For what it's worth, it's also true that there are some elements of VB that have no equivalent in C#, e.g. exception filters.
If you've developed it your self I assume you have access to the source? If so you can just convert it all though here:

- 2,074
- 14
- 17