Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Distribution: Currently: OpenMandriva. Previously: openSUSE, PCLinuxOS, CentOS, among others over the years.
Posts: 3,881
Rep:
Quote:
Originally Posted by slcklnx
hi
help me!
Code:
>c.cs
>cls.cs
chmod 777 c.cs
chmod 777 cls.cs
nano cls
namespace A{
public class cls{
public int a;
}
}
nano c.cs
Code:
using System;
using A;
class c{
public static void Main(){
}
}
mcs c.cs
mono c.exe
I can’t connect the class. Tell me how to do it.
From the very little I know about C# (C Sharp), it's a Microsoft language for Windows, and the above does not look valid at all to me - it looks like you're trying to mix a bash script with C# - I don't think you can do that. The .exe extension is for a Windows executable file, which will not run under Linux unless you have Wine installed and run it through that.
Also, your post is very vague. What exactly are you trying to write?
This question is very inadequate, giving little information except a plea for help.
You've posted on the LQ forums enough to realize that this level of incomplete question is not helpful. Instructing your fellow LQ members to "Tell me how to do it" is not appropriate.
Recommend you follow some of the tutorials from mono to enable you to complete your first project. They do exist for Linux environments.
The .exe extension is for a Windows executable file, which will not run under Linux unless
The "mono" in the OP's post is a .net emulator for Linux, so with a correctly built .exe he should be able to run it (as C# is the compiler for .net executables).
But I don't see him compiling the cls.cs source, so the exe seems to be incomplete, he may need something like
Code:
mcs c.cs cls.cs
(I'm just guessing, I do not know this mcs compiler).
From the very little I know about C# (C Sharp), it's a Microsoft language for Windows, and the above does not look valid at all to me - it looks like you're trying to mix a bash script with C# - I don't think you can do that. The .exe extension is for a Windows executable file, which will not run under Linux unless you have Wine installed and run it through that.
They aren't running this .exe on Linux itself but under Mono which is an open source implementation of MS .NET. With the mono interpreter/VM running on Linux they can execute a .NET .exe.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.