locked
Using C# to develop linux or macOS applications RRS feed

  • Question

  • Hi Team,

    How to develop applications for linux or macOS using C#.

    I have the following C# IDE in windows 10

    • Xamarin Studio IDE
    • Visual Studio 2017

    I strongly apologize if this question is asked any where else.

    Thanks.


    Roshan - 8th Grade Student (Age 12) - Learning Small Basic, Visual Basic and C#

    Tuesday, August 28, 2018 11:51 AM

Answers

  • Hi Roshan Kumar Priya,

    The following about Prerequisites for .NET Core on Linux & MACoS for your reference.

    #Linux

    https://docs.microsoft.com/en-us/dotnet/core/linux-prerequisites?tabs=netcore2x

    #MasOS.

    https://docs.microsoft.com/en-us/dotnet/core/macos-prerequisites?tabs=netcore2x

    Best regards,

    Zhanglong


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by [Roshan_Kumar] Wednesday, August 29, 2018 10:50 AM
    Wednesday, August 29, 2018 9:32 AM
  • Here is a getting started documentation from microsoft:

    https://docs.microsoft.com/en-us/dotnet/core/get-started?tabs=windows

    To deploy an app you have to run the following command (in the project folder):

    dotnet publish -c Release

    You will find the app files in the bin\Release\netcoreappX.X\publish folder. To run the app use the following command (you must have the runtime installed in the target pc):

    dotnet MyApplication.dll



    Wednesday, August 29, 2018 10:28 AM

All replies

  • .Net core is your answer, look it up.
    Tuesday, August 28, 2018 12:21 PM
  • .Net core is your answer, look it up.

    Hi,

    I have tried .NET Core already. I made a .NET CORE console application and when I tried it to run on Ubuntu, there were the following files.

    MyApplication.deps.json

    MyApplication.runtimeconfig.json

    MyApplication.runtimeconfig.dev.json

    MyApplication.exe

    MyApplication.pdb

    MyApplication.dll

    How do I run these files on Ubuntu or macOS?

    My application uses Process()

    Thanks.


    Roshan - 8th Grade Student (Age 12) - Learning Small Basic, Visual Basic and C#



    Tuesday, August 28, 2018 2:30 PM
  • Hi,

    My code

    using System;
    using System.Diagnostics;
    using System.IO;
    namespace Small_Basic
    {
        class Program
        {
            static void Main(string[] args)
            {
                Console.Title = "Small Basic";
                Console.WriteLine("Enter the directory of the .sb file to be compiled");
                String path = Console.ReadLine();
                string compiler = "";
                compiler = AppDomain.CurrentDomain.BaseDirectory + @"\SmallBasicCompiler.exe";
    Process p = new Process();
                    ProcessStartInfo psi = new ProcessStartInfo();
                    psi.FileName = compiler;
                    psi.Arguments = "\"" + Path.GetFileName(path) + "\"";
                    psi.WorkingDirectory = Path.GetDirectoryName(path);
                    psi.RedirectStandardOutput = true;
                    psi.UseShellExecute = false;
                    psi.CreateNoWindow = true;
                    p.StartInfo = psi;
                    p.Start();
                    string result = Path.GetDirectoryName(path) + "\\" + Path.GetFileNameWithoutExtension(path) + ".exe";
                Console.WriteLine("Press any key to continue...");
                    Console.ReadKey();
            }
        }
    }
    

    The application to be started is there in the same folder.

    Thanks.


    Roshan - 8th Grade Student (Age 12) - Learning Small Basic, Visual Basic and C#

    Tuesday, August 28, 2018 2:34 PM
  • https://docs.microsoft.com/en-us/dotnet/core/linux-prerequisites?tabs=netcore2x

    Being and Google are your friends.

    Tuesday, August 28, 2018 4:58 PM
  • I have never done it myself. So I can't tell you how to do it. You should use Bing and Google to look for articles on how to do it.
    Tuesday, August 28, 2018 5:00 PM
  • Hi Roshan Kumar Priya,

    The following about Prerequisites for .NET Core on Linux & MACoS for your reference.

    #Linux

    https://docs.microsoft.com/en-us/dotnet/core/linux-prerequisites?tabs=netcore2x

    #MasOS.

    https://docs.microsoft.com/en-us/dotnet/core/macos-prerequisites?tabs=netcore2x

    Best regards,

    Zhanglong


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by [Roshan_Kumar] Wednesday, August 29, 2018 10:50 AM
    Wednesday, August 29, 2018 9:32 AM
  • Here is a getting started documentation from microsoft:

    https://docs.microsoft.com/en-us/dotnet/core/get-started?tabs=windows

    To deploy an app you have to run the following command (in the project folder):

    dotnet publish -c Release

    You will find the app files in the bin\Release\netcoreappX.X\publish folder. To run the app use the following command (you must have the runtime installed in the target pc):

    dotnet MyApplication.dll



    Wednesday, August 29, 2018 10:28 AM
  • Thank you all.

    Roshan - 8th Grade Student (Age 12) - Learning Small Basic, Visual Basic and C#

    Wednesday, August 29, 2018 10:51 AM