Help get this topic noticed by sharing it on Twitter, Facebook, or email.

vb.net to c#

I inherited a project generated as VB.Net. Is there a way to change some setting(s) to be able to regenerate the project with C# instead?

No business rules or custom code, so basically want to regenerate the whole project in C#

Thanks

R
1 person has
this question
+1
Reply
  • 1
    After some trial-and-error steps, these steps seem to completely converted a VB.net web project to a CSharp solution.

    Note: The inherited project did NOT contain any custom code in VB.net so there was no need to manually convert any VB code.

    All steps below in under the COT Project folder
    =================================================
    1) ** Make a backup copy of the project (IMPORTANT)
    2) Edit \\DataAquarium.project.xml and change codeDomProvider from "VisualBasic" --> "CSharp"
    3) Refresh Project
    4) Generate Project
    5) Delete all visual basic file (*.vb) in all subfolders under project.
    6) Modify Login.ascx from "VB" to "C#"
    7) Modify LOGIN in "User Controls" tab to "Always" generate to regenerate the login.ascx. Reset back to "First Time Only" after successful regeneration.
    8) GENERATE code
    9) TEST application
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. indifferent, undecided, unconcerned sad, anxious, confused, frustrated happy, confident, thankful, excited kidding, amused, unsure, silly

  • UPDATE: Might just found an issue with the VB.net to C# conversion.

    Everything seems to work fine in COT environment as reported above.

    Unfortunately, when we try to do a PUBLISH from with COT, it is giving us compile error starting with "error ASPPARSE: The language of the code file is inconsistent with the language of the page" on the /controls/RefreshDataView.ascx ... which now suddenly contains the .ascx.VB. Any attempt to simply change the "vb" to "c#' then generates hundred of error referring to other .vb files. Very strange.

    So there seems to be different code for Browse\Generate vs. Publish.

    The compile fails and so the PUBLISH also fails too

    Might have to use a support session for this error if we cannot resolve it
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. indifferent, undecided, unconcerned sad, anxious, confused, frustrated happy, confident, thankful, excited kidding, amused, unsure, silly

  • UPDATE again:

    So in Visual Studio, we had to change any references to ".vb" back to ".cs". Also had to DELETE all the files with .VB extension AGAIN (similar to the original post above. The we generated once more.

    The PUBLISH then worked as expected. Was able to use the publish files to deploy to the web server.

    Something is definitely different from GENERATE and PUBLISH, just cannot tell what cause it to revert back to VB.net
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. indifferent, undecided, unconcerned sad, anxious, confused, frustrated happy, confident, thankful, excited kidding, amused, unsure, silly