locked
VB>Net website to C# Conversion RRS feed

  • Question

  • User577498514 posted

    We are going to convert the ASP.Net VB.Net website to web application, right now i am doing some prototyping and its going on word but its taking time because i was able to find some tools that are used to convert VB.Net to C# but they are not good enough.

    I have found several articles but none of them is applicable perfectly, Requirement is that we have five ASP.Net web sites , 1 is very large and rest are medium size, from medium it means have not more then 60 pages,What are exactly steps to convert website to web application and then conversion from VB.Net to C# with minimum time?

    Tuesday, November 5, 2019 11:20 AM

Answers

  • User475983607 posted

    We are going to convert the ASP.Net VB.Net website to web application, right now i am doing some prototyping and its going on word but its taking time because i was able to find some tools that are used to convert VB.Net to C# but they are not good enough.

    I have found several articles but none of them is applicable perfectly, Requirement is that we have five ASP.Net web sites , 1 is very large and rest are medium size, from medium it means have not more then 60 pages,What are exactly steps to convert website to web application and then conversion from VB.Net to C# with minimum time?

    Every web project is different.  There's no "exactly steps to convert website to web application and then conversion from VB.Net to C# with minimum time". The ease of converting is greatly dependent on the design.  For example, it is easier to convert applications that use a layer design approach.  C# can reference VB.NET libraries so you do not have to convert a VB.NET library to C# immediately or ever.

    Unfortunately there's no way for the community to provide a solution.  We can only point you to migration documents and Google.

    https://devblogs.microsoft.com/aspnet/converting-a-web-site-project-to-a-web-application-project/

    https://forums.asp.net/t/2139425.aspx?How+to+convert+existing+Website+Solution+to+Web+application+solution+on+Visual+Studio+2017+IDE+

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, November 5, 2019 1:20 PM
  • User-1780421697 posted

    Website to web application is one major effort and Conversion to C# is another.

    To simplify you can separate you business and domain/infrastructure logic from website App_Code and put them in separate class libraries, You C# class libraray can be used in ASP.Net (VB.Net ) website so you should try to move code to outside class libraries as much as possible, you business entities and classes should go to Domain project, infrastructure related stuff goes in Infra class libraries and so on. Try to reference your packages through Nuget not like classic way. Move you helper method and other stuff to relevant class libraries as well.

    When all done then you need to create a project of C# web application (Web Forms) and move all your old stuff except App_Code in to new project and try to resolve the issues if there are some, Then go to Project menu and click on Convert To Web Application project , this will add designer files of your web pages.

    C# Conversion:

    https://marketplace.visualstudio.com/items?itemName=SharpDevelopTeam.CodeConverter

    You can use the extension to convert the classes to C# and you can also have option of conversion to C# at project level (Web application). There is some manual effort on .aspx and other pages where you need to user AutoEventWireUp=true in C# and also take care of some minor changes.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, November 12, 2019 10:48 AM

All replies

  • User475983607 posted

    We are going to convert the ASP.Net VB.Net website to web application, right now i am doing some prototyping and its going on word but its taking time because i was able to find some tools that are used to convert VB.Net to C# but they are not good enough.

    I have found several articles but none of them is applicable perfectly, Requirement is that we have five ASP.Net web sites , 1 is very large and rest are medium size, from medium it means have not more then 60 pages,What are exactly steps to convert website to web application and then conversion from VB.Net to C# with minimum time?

    Every web project is different.  There's no "exactly steps to convert website to web application and then conversion from VB.Net to C# with minimum time". The ease of converting is greatly dependent on the design.  For example, it is easier to convert applications that use a layer design approach.  C# can reference VB.NET libraries so you do not have to convert a VB.NET library to C# immediately or ever.

    Unfortunately there's no way for the community to provide a solution.  We can only point you to migration documents and Google.

    https://devblogs.microsoft.com/aspnet/converting-a-web-site-project-to-a-web-application-project/

    https://forums.asp.net/t/2139425.aspx?How+to+convert+existing+Website+Solution+to+Web+application+solution+on+Visual+Studio+2017+IDE+

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, November 5, 2019 1:20 PM
  • User1120430333 posted

    We are going to convert the ASP.Net VB.Net website to web application, right now i am doing some prototyping and its going on word but its taking time because i was able to find some tools that are used to convert VB.Net to C# but they are not good enough.

    You do the conversion manually.

    I have found several articles but none of them is applicable perfectly, Requirement is that we have five ASP.Net web sites , 1 is very large and rest are medium size, from medium it means have not more then 60 pages,What are exactly steps to convert website to web application and then conversion from VB.Net to C# with minimum time?

    You do it manually, using conversion tools are not good enough.

    I worked on a conversion of a  large desktop solution from VB 6 over to VB.NET, and it was all done manually. Work on conversion of solution form VB.NET to C# and it was all done manually.

    Friday, November 8, 2019 8:55 PM
  • User-1780421697 posted

    Website to web application is one major effort and Conversion to C# is another.

    To simplify you can separate you business and domain/infrastructure logic from website App_Code and put them in separate class libraries, You C# class libraray can be used in ASP.Net (VB.Net ) website so you should try to move code to outside class libraries as much as possible, you business entities and classes should go to Domain project, infrastructure related stuff goes in Infra class libraries and so on. Try to reference your packages through Nuget not like classic way. Move you helper method and other stuff to relevant class libraries as well.

    When all done then you need to create a project of C# web application (Web Forms) and move all your old stuff except App_Code in to new project and try to resolve the issues if there are some, Then go to Project menu and click on Convert To Web Application project , this will add designer files of your web pages.

    C# Conversion:

    https://marketplace.visualstudio.com/items?itemName=SharpDevelopTeam.CodeConverter

    You can use the extension to convert the classes to C# and you can also have option of conversion to C# at project level (Web application). There is some manual effort on .aspx and other pages where you need to user AutoEventWireUp=true in C# and also take care of some minor changes.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, November 12, 2019 10:48 AM
  • User577498514 posted

    We are facing several issues of website, Coding validation through tool is not working and most of the tools  only work on the Web application, hopefully conversion to web application also take less time to build large website with complex data in App_Code.

    Tuesday, November 12, 2019 1:26 PM
  • User1120430333 posted

    We are facing several issues of website, Coding validation through tool is not working and most of the tools  only work on the Web application, hopefully conversion to web application also take less time to build large website with complex data in App_Code.

    In App_Code? I see nothing but problems for you. 

    Wednesday, November 13, 2019 1:14 AM