Hack Forums
[.NET] Converting a vb.net project to c# - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151)
+---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118)
+---- Thread: [.NET] Converting a vb.net project to c# (/showthread.php?tid=5451362)



Converting a vb.net project to c# - Seifer - Nov 1, 2016

Hey HF I got a fairly large project made in vb.net which is a language I am fairly useless working with xD

Okay so I am trying to convert the entire project to c#, I know this is possible to a degree using sharpDevelop however this project relies on a dll.

Is it possible to still convert the project? 😧 Maybe by somehow decompiling the dll and the recompile for c#? :P

Any help on this would be greatly appreciated 🤝
Thanks for reading.


* - sh@rp - Nov 1, 2016

(Nov 1, 2016 03:51 PM)Izay‎a Wrote:  Hey HF I got a fairly large project made in vb.net which is a language I am fairly useless working with xD

What you're fairly useless working with is your IDE........
Why don't you reference the dll in your main C# project ???
Done.


* - Seifer - Nov 1, 2016

(Nov 1, 2016 04:00 PM)Ch@rLi3 (3D۞tD3v) Wrote:  What you're fairly useless working with is your IDE........
Why don't you reference the dll in your main C# project ???
Done.

I thought a vb compiled from vb only worked with vb 😧
However this means that the project didn't convert correctly as I am getting a ton of errors now, I thought this was because it was referencing a vb dll but if this does not matter then I got a lot of work to do x-x

Thanks for the info 🤝


* - sh@rp - Nov 1, 2016

(Nov 1, 2016 04:09 PM)Izay‎a Wrote:  I thought a vb compiled from vb only worked with vb 😧
However this means that the project didn't convert correctly as I am getting a ton of errors now, I thought this was because it was referencing a vb dll but if this does not matter then I got a lot of work to do x-x

Thanks for the info 🤝

Don't bother.

good luck bro. ;)


* - Marwix - Nov 2, 2016

How 'large' is your project? (lines of code, size etc)

I might be able to do it for you but not for free.

Lmk.


* - Null Agent - Nov 2, 2016

Use SharpDevelop (version 4.4) which allows you to convert the whole C# project to VB.NET and vice-versa.
It's really fast and only needs like 4 clicks to complete the process.


* - cnuts - Nov 2, 2016

(Nov 1, 2016 03:51 PM)Izay‎a Wrote:  Hey HF I got a fairly large project made in vb.net which is a language I am fairly useless working with xD

Okay so I am trying to convert the entire project to c#, I know this is possible to a degree using sharpDevelop however this project relies on a dll.
...

If You have the code:

I've only used the online converter options. I'm not familiar with any tools out there which automate this but there may be. In the past I've done it file at a time with a online converter. You'll need to setup another solution, recreate file for file with your references. It amounts to a lost of copy and pasting in and out of the tool. This could be tedious and worth exercising your google fu for an automated option.

If you only have a DLL:
Download and install Reflector. I believe Telerik owns it but there are other .Net decompilers out there. Some will display the IL in C# or VB.Net


* - Seifer - Nov 2, 2016

(Nov 2, 2016 02:44 AM)Marwix Wrote:  How 'large' is your project? (lines of code, size etc)

I might be able to do it for you but not for free.

Lmk.

Thanks for the offer but I just found out that one of the developers from the project I am trying to convert went has recreated it with more features in C#, its not open source yet but is going open source soon 🤗


(Nov 2, 2016 05:05 AM)Null Agent Wrote:  Use SharpDevelop (version 4.4) which allows you to convert the whole C# project to VB.NET and vice-versa.
It's really fast and only needs like 4 clicks to complete the process.

lol read the original post, already said I was using sharpDevelop's convert feature 🤝


* - 帖子作者 - Nov 2, 2016

You can use the DLL in C#


* - toliko - Nov 3, 2016

vb.net and c# both are .Net so you can basically use the dll in C#


* - sh@rp - Nov 3, 2016

(Nov 2, 2016 09:00 PM)Scorpi0n Wrote:  You can use the DLL in C#

(Nov 3, 2016 02:27 AM)toliko Wrote:  vb.net and c# both are .Net so you can basically use the dll in C#

As mentionned here : https://hackforums.net/showthread.php?tid=5451362&pid=52962706#pid52962706