Issue related to Debian/Linux OS

Peter_1985 2,686 Reputation points
2024-10-03T07:54:28.1866667+00:00

Hi,

Is it right that we can run/execute VS C++/C# project within Debian/Linux OS?

C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
11,002 questions
{count} votes

3 answers

Sort by: Most helpful
  1. Jiachen Li-MSFT 32,056 Reputation points Microsoft Vendor
    2024-10-07T02:27:48.0133333+00:00

    Step-by-Step Guide to Install WineHQ on Ubuntu

    Enable 32-bit architecture (necessary for Wine to run 32-bit Windows applications):

    sudo dpkg --add-architecture i386
    

    Download and add the WineHQ repository key:

    sudo mkdir -pm755 /etc/apt/keyrings
    sudo wget -O /etc/apt/keyrings/winehq-archive.key https://dl.winehq.org/wine-builds/winehq.key
    

    Add the WineHQ repository:

    • For Ubuntu 22.04 (or modify the version if you're using a different one):
         sudo wget -NP /etc/apt/sources.list.d/ https://dl.winehq.org/wine-builds/ubuntu/dists/jammy/winehq-jammy.sources
      
      Replace jammy with your Ubuntu version codename (e.g., focal for Ubuntu 20.04, bionic for 18.04, etc.). Update the package lists:
         sudo apt update
      

    Install WineHQ Stable:

       sudo apt install --install-recommends winehq-stable
    
    1 person found this answer helpful.
    0 comments No comments

  2. Jiachen Li-MSFT 32,056 Reputation points Microsoft Vendor
    2024-10-03T08:08:52.8866667+00:00

    Hi @Peter_1985 ,

    C# .NET Core/5/6+ and cross-platform C++ projects can run natively on Debian/Linux, while older .NET Framework and Windows-specific C++ projects require porting or a compatibility layer like Wine.

    Best Regards.

    Jiachen Li


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment". Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


  3. Bruce (SqlWork.com) 66,226 Reputation points
    2024-10-04T16:15:46.4766667+00:00

    Visual studio supports cross platform C/C++ projects. Its uses a Linux compatible cmake file so you can build on Linux with the Linux C/C++ compiler.

    https://learn.microsoft.com/en-us/cpp/build/get-started-linux-cmake?view=msvc-170

    If you install the Linux tools (WSL) you can build the Linux executable (which will not have a file extension) on your windows box.

    https://learn.microsoft.com/en-us/windows/wsl/install

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.