How Convert VB Project to C# Project [closed]

折月煮酒 提交于 2019-11-27 09:35:16

问题


I have a project written in VB, and I need to convert the whole project to C# project. I don't want to do it file by file, I found some online converters, but they convert only lines of codes, not the whole project. I found on researches, and here was written that I saw this question , there was written that

"The best part about Sharpdevelop is it converts the whole project (source files) from VB and C# and the other way"

And I also researched on Google, that if you Right Click on the project, I found here , that "Right click on the project in the Projects window and select Convert - From VB.NET to C#". But when I right click on The Project in the Projects window, I can'd find that "Convert". Is there any tool I have to install for SharpDevelop and then I will be able to convert my project ? Thanks


回答1:


I am assuming you tried SharpDevelop 5 since the conversion feature was missing in that version.

The VB to C# code converter from the SharpDevelop team is now a standalone extension to Visual Studio. Once installed, you can convert an entire VB.NET project to C# by opening the solution, right clicking the solution node in the Solution Explorer and selecting Convert to C#.




回答2:


Sorry but I've not come across any tools that will convert the entire project. I've just created a interim c# project and converted small parts at a section at time, in the past. The conversion is not a straight one-2-one code map for a variety of reasons due to the differences in the languages. Small steps and some good unit testing help speed things up. Alternatively if your code uses code generators tools supplied by CodesmithTools, they often have compiler switches that will help change .net languages. This will definitely help in my humble opinion.



来源:https://stackoverflow.com/questions/25112982/how-convert-vb-project-to-c-sharp-project

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!