VB to C#

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Miro

    VB to C#

    I have a question.

    Currently my Visual Studios 2008 has its main language and setup setup as
    vb.net

    I want to ( temporarily ) switch it to compile and do things as if it was a
    C# or C++ compiler and work area.

    What would I need to change to do this?

    and then change it back?

    -Or is this even possible
    Thanks,

    Miro

  • Scott M.

    #2
    Re: VB to C#

    When you create a new project, you can choose the language you wish the new
    project to be in. After that choice is made, that project will compile
    using the correct compiler.

    So, all you have to do is make a new project, but select from the "other
    languages" node of the new project dialog box.

    If you want the language change to be more perminent, go to the Tools menu
    and choose "Import and Export Settings". Then choose "Reset all settings",
    then close Visual Studio and re-open it. When it re-opens, you'll be able
    to select the primary programming language.

    -Scott

    "Miro" <miro@beero.com wrote in message
    news:en%23Np7bH JHA.4080@TK2MSF TNGP05.phx.gbl. ..
    >I have a question.
    >
    Currently my Visual Studios 2008 has its main language and setup setup as
    vb.net
    >
    I want to ( temporarily ) switch it to compile and do things as if it was
    a C# or C++ compiler and work area.
    >
    What would I need to change to do this?
    >
    and then change it back?
    >
    -Or is this even possible
    Thanks,
    >
    Miro

    Comment

    • Miro

      #3
      Re: VB to C#

      Thank you,

      I was trying to do it within a project already open and could not find a
      "switch" button.

      Creating a 'new project' was exactly what I was looking for.

      Thank you,

      Miro

      "Scott M." <s-mar@nospam.nosp amwrote in message
      news:uluyrHcHJH A.3668@TK2MSFTN GP02.phx.gbl...
      When you create a new project, you can choose the language you wish the
      new project to be in. After that choice is made, that project will
      compile using the correct compiler.
      >
      So, all you have to do is make a new project, but select from the "other
      languages" node of the new project dialog box.
      >
      If you want the language change to be more perminent, go to the Tools menu
      and choose "Import and Export Settings". Then choose "Reset all
      settings", then close Visual Studio and re-open it. When it re-opens,
      you'll be able to select the primary programming language.
      >
      -Scott
      >
      "Miro" <miro@beero.com wrote in message
      news:en%23Np7bH JHA.4080@TK2MSF TNGP05.phx.gbl. ..
      >>I have a question.
      >>
      >Currently my Visual Studios 2008 has its main language and setup setup as
      >vb.net
      >>
      >I want to ( temporarily ) switch it to compile and do things as if it was
      >a C# or C++ compiler and work area.
      >>
      >What would I need to change to do this?
      >>
      >and then change it back?
      >>
      >-Or is this even possible
      >Thanks,
      >>
      >Miro
      >
      >

      Comment

      • Scott M.

        #4
        Re: VB to C#

        You cannot switch languages within a project because the various items in
        your project compile down to a single assembly file. As such all items
        within a single project must use a single .NET language.

        You could have one solution that contains different projects and each
        project could be written in a different .NET language.

        -Scott

        "Miro" <miro@beero.com wrote in message
        news:e5mKbieHJH A.4296@TK2MSFTN GP02.phx.gbl...
        Thank you,
        >
        I was trying to do it within a project already open and could not find a
        "switch" button.
        >
        Creating a 'new project' was exactly what I was looking for.
        >
        Thank you,
        >
        Miro
        >
        "Scott M." <s-mar@nospam.nosp amwrote in message
        news:uluyrHcHJH A.3668@TK2MSFTN GP02.phx.gbl...
        >When you create a new project, you can choose the language you wish the
        >new project to be in. After that choice is made, that project will
        >compile using the correct compiler.
        >>
        >So, all you have to do is make a new project, but select from the "other
        >languages" node of the new project dialog box.
        >>
        >If you want the language change to be more perminent, go to the Tools
        >menu and choose "Import and Export Settings". Then choose "Reset all
        >settings", then close Visual Studio and re-open it. When it re-opens,
        >you'll be able to select the primary programming language.
        >>
        >-Scott
        >>
        >"Miro" <miro@beero.com wrote in message
        >news:en%23Np7b HJHA.4080@TK2MS FTNGP05.phx.gbl ...
        >>>I have a question.
        >>>
        >>Currently my Visual Studios 2008 has its main language and setup setup
        >>as vb.net
        >>>
        >>I want to ( temporarily ) switch it to compile and do things as if it
        >>was a C# or C++ compiler and work area.
        >>>
        >>What would I need to change to do this?
        >>>
        >>and then change it back?
        >>>
        >>-Or is this even possible
        >>Thanks,
        >>>
        >>Miro
        >>
        >>
        >

        Comment

        • Miro

          #5
          Re: VB to C#

          Thats perfect.
          -I'm to new to visual studios still to know - but I thought there was a way
          to have a c# class called by vb.net
          ( i know if a class is written in vb.net you shouldnt use "optional"
          paramters ), but with my top statement, im assuming by your reply that that
          class must be in a C# project to be called?

          I am expecting to get some code from someone that will be in C# to try to
          debug it, and I was just getting ready to see how to 'open' and play with
          the c# files.

          I dont plan to re-write it ( maybe fix it ) but at least debug it to where
          the problem lies.

          Thanks for all your help.

          Miro

          "Scott M." <s-mar@nospam.nosp amwrote in message
          news:%23jaHk1oH JHA.3736@TK2MSF TNGP06.phx.gbl. ..
          You cannot switch languages within a project because the various items in
          your project compile down to a single assembly file. As such all items
          within a single project must use a single .NET language.
          >
          You could have one solution that contains different projects and each
          project could be written in a different .NET language.
          >
          -Scott
          >
          "Miro" <miro@beero.com wrote in message
          news:e5mKbieHJH A.4296@TK2MSFTN GP02.phx.gbl...
          >Thank you,
          >>
          >I was trying to do it within a project already open and could not find a
          >"switch" button.
          >>
          >Creating a 'new project' was exactly what I was looking for.
          >>
          >Thank you,
          >>
          >Miro
          >>
          >"Scott M." <s-mar@nospam.nosp amwrote in message
          >news:uluyrHcHJ HA.3668@TK2MSFT NGP02.phx.gbl.. .
          >>When you create a new project, you can choose the language you wish the
          >>new project to be in. After that choice is made, that project will
          >>compile using the correct compiler.
          >>>
          >>So, all you have to do is make a new project, but select from the "other
          >>languages" node of the new project dialog box.
          >>>
          >>If you want the language change to be more perminent, go to the Tools
          >>menu and choose "Import and Export Settings". Then choose "Reset all
          >>settings", then close Visual Studio and re-open it. When it re-opens,
          >>you'll be able to select the primary programming language.
          >>>
          >>-Scott
          >>>
          >>"Miro" <miro@beero.com wrote in message
          >>news:en%23Np7 bHJHA.4080@TK2M SFTNGP05.phx.gb l...
          >>>>I have a question.
          >>>>
          >>>Currently my Visual Studios 2008 has its main language and setup setup
          >>>as vb.net
          >>>>
          >>>I want to ( temporarily ) switch it to compile and do things as if it
          >>>was a C# or C++ compiler and work area.
          >>>>
          >>>What would I need to change to do this?
          >>>>
          >>>and then change it back?
          >>>>
          >>>-Or is this even possible
          >>>Thanks,
          >>>>
          >>>Miro
          >>>
          >>>
          >>
          >
          >

          Comment

          • Scott M.

            #6
            Re: VB to C#

            A C# assembly can be called from a VB .NET assembly (and vice versa), but C#
            source code cannot be called by VB .NET source code (and vice versa).

            This is why (if you want to do this), you need to have 2 different projects
            in one solution. Each project compiles down to its own assembly, and thus a
            class in one assembly can be used by another assembly (after the first
            assembly makes a reference to the other).


            "Miro" <miro@beero.com wrote in message
            news:%23bMKhFxH JHA.5060@TK2MSF TNGP02.phx.gbl. ..
            Thats perfect.
            -I'm to new to visual studios still to know - but I thought there was a
            way to have a c# class called by vb.net
            ( i know if a class is written in vb.net you shouldnt use "optional"
            paramters ), but with my top statement, im assuming by your reply that
            that class must be in a C# project to be called?
            >
            I am expecting to get some code from someone that will be in C# to try to
            debug it, and I was just getting ready to see how to 'open' and play with
            the c# files.
            >
            I dont plan to re-write it ( maybe fix it ) but at least debug it to where
            the problem lies.
            >
            Thanks for all your help.
            >
            Miro
            >
            "Scott M." <s-mar@nospam.nosp amwrote in message
            news:%23jaHk1oH JHA.3736@TK2MSF TNGP06.phx.gbl. ..
            >You cannot switch languages within a project because the various items in
            >your project compile down to a single assembly file. As such all items
            >within a single project must use a single .NET language.
            >>
            >You could have one solution that contains different projects and each
            >project could be written in a different .NET language.
            >>
            >-Scott
            >>
            >"Miro" <miro@beero.com wrote in message
            >news:e5mKbieHJ HA.4296@TK2MSFT NGP02.phx.gbl.. .
            >>Thank you,
            >>>
            >>I was trying to do it within a project already open and could not find a
            >>"switch" button.
            >>>
            >>Creating a 'new project' was exactly what I was looking for.
            >>>
            >>Thank you,
            >>>
            >>Miro
            >>>
            >>"Scott M." <s-mar@nospam.nosp amwrote in message
            >>news:uluyrHcH JHA.3668@TK2MSF TNGP02.phx.gbl. ..
            >>>When you create a new project, you can choose the language you wish the
            >>>new project to be in. After that choice is made, that project will
            >>>compile using the correct compiler.
            >>>>
            >>>So, all you have to do is make a new project, but select from the
            >>>"other languages" node of the new project dialog box.
            >>>>
            >>>If you want the language change to be more perminent, go to the Tools
            >>>menu and choose "Import and Export Settings". Then choose "Reset all
            >>>settings", then close Visual Studio and re-open it. When it re-opens,
            >>>you'll be able to select the primary programming language.
            >>>>
            >>>-Scott
            >>>>
            >>>"Miro" <miro@beero.com wrote in message
            >>>news:en%23Np 7bHJHA.4080@TK2 MSFTNGP05.phx.g bl...
            >>>>>I have a question.
            >>>>>
            >>>>Currently my Visual Studios 2008 has its main language and setup setup
            >>>>as vb.net
            >>>>>
            >>>>I want to ( temporarily ) switch it to compile and do things as if it
            >>>>was a C# or C++ compiler and work area.
            >>>>>
            >>>>What would I need to change to do this?
            >>>>>
            >>>>and then change it back?
            >>>>>
            >>>>-Or is this even possible
            >>>>Thanks,
            >>>>>
            >>>>Miro
            >>>>
            >>>>
            >>>
            >>
            >>
            >

            Comment

            Working...