Search code examples
c#linuxvisual-studiocompilation

How to I run a file on ubuntu which i compiled with Visual Studio on Windows for Linux


I compiled a C# project in VS2022 with this settings:

compilersettings

It produced a file without a file extension.

How to I run in from linux?


Solution

  • You could flag your file as executable:

    cd you_vs_code_foler/bin/Release/net6.0/publish/linux-x64
    
    chmod +x your_programm
    
    ./your_programm
    

    If you need to install .NET runtime at Ubuntu: try this:

    sudo apt-get install -y dotnet-runtime-6.0
    

    For further information and for other distrubtions please consult: https://learn.microsoft.com/en-us/dotnet/core/install/linux