简体   繁体   English

如何在 ubuntu 上运行一个文件,该文件是我用 Visual Studio 在 Windows 上为 Linux 编译的

[英]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:我使用以下设置在 VS2022 中编译了一个 C# 项目:

编译器设置

It produced a file without a file extension.它生成了一个没有文件扩展名的文件。

How to I run in from linux?如何从 linux 运行?

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:如果您需要在 Ubuntu 安装 .NET 运行时:试试这个:

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

For further information and for other distrubtions please consult: https://docs.microsoft.com/en-us/dotnet/core/install/linux有关更多信息和其他分布,请咨询: https://docs.microsoft.com/en-us/dotnet/core/install/linux

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何配置Visual Studio代码以从Windows的Linux子系统(WSL)运行/调试.NET(dotnet)Core? - How can I configure Visual Studio Code to run/debug .NET (dotnet) Core from the Windows Subsystem for Linux (WSL)? 如何在visual studio中编译和运行ashx文件? - How do I compile and run an ashx file in visual studio? 如何从Windows C#(Visual Studio)运行cygwin编译的程序? - How do you run a cygwin-compiled program from windows c# (visual studio)? 如何在Windows 10中运行在ubuntu中创建的C#Visual Studio项目 - How to run c# visual studio project created in ubuntu in windows 10 我们可以在 Linux Ubuntu 中从应用程序为 Windows 安装 Microsoft Visual Studio(不是 Visual Studio 代码)吗? - Are we able to install Microsoft Visual Studio(not Visual Studio code) in Linux Ubuntu for windows from application? 如何启用Visual Studio(windows)和Docker(linux-image)在同一文件夹中同时运行? - How to enable Visual Studio (windows) and Docker (linux-image) to be run at the same time at the same folder? 我无法在Visual Studio外部运行EXE文件 - I Cant Run EXE File Outside of Visual Studio 我可以在Visual Studio项目中运行XAML文件的两个实例吗? - Can I run two instances of a XAML file in a Visual Studio project? 如何在Windows窗体中将.png文件用作按钮? (在C#中 - visual studio 2013) - How can I use a .png file as a button in Windows Form ? ( in C# - visual studio 2013 ) 如何为目录中的每个文件运行Visual Studio单元测试? - How do I run a Visual Studio unit test for each file in a directory?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM