简体   繁体   English

我们可以将 C# dll 反编译为 VB.NET

[英]Can we decompile a C# dll to VB.NET

I have developed a dll in C#.net.我在 C#.net 中开发了一个 dll。 Can we decompile the same in VB.net.我们可以在 VB.net 中反编译相同的内容吗? If yes, how to do that?如果是,如何做到这一点?

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).使用Reflector 之类的工具将已编译的 C# 程序集 (IL) 转换为反编译的 VB.NET 源代码(可能会因某些变量名称而失去某些含义)。 Another post mentions some free alternatives to Reflector.另一篇文章提到了 Reflector 的一些免费替代品。

Or convert the C# code using an online resource such as this one (1 code file at a time though).或者使用在线资源(例如一次1 个代码文件)转换 C# 代码。

I agree with Mitch, but as a free alternative to Reflector:我同意 Mitch,但作为 Reflector 的免费替代品:

Assuming you have the source, you can use sharpdevelop to convert whole solutions back and forth between c#.net and vb.net假设你有源,你可以使用sharpdevelop在c#.net和vb.net之间来回转换整个解决方案

The same group also developed a plugin for visual studio: Code Converter C# to/from VB.NET同组还为visual studio开发了一个插件: Code Converter C# to/from VB.NET

Sometimes C# cannot be converted (or decompiled) into VB.Net because there are some elements of C# that have no equivalent in VB.有时 C# 无法转换(或反编译)为 VB.Net,因为 C# 的某些元素在 VB 中没有等效项。 Eg iterators ( yield ) and unsafe code.例如迭代器( yield )和不安全的代码。 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.从 VB.Net 代码中使用 C# DLL 可能很容易:您可以调用它,也可以继承它。 " CLS compliance " will help with this. CLS 合规性”将对此有所帮助。

For what it's worth, it's also true that there are some elements of VB that have no equivalent in C#, eg exception filters.就其价值而言,VB 的某些元素在 C# 中没有等价物也是事实,例如异常过滤器。

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:如果是这样,您可以在此处将其全部转换:

http://www.developerfusion.com/tools/convert/csharp-to-vb/ http://www.developerfusion.com/tools/convert/csharp-to-vb/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM