Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3393874
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T04:06:10+00:00 2026-05-18T04:06:10+00:00

I have a c# source file. Is there any way to put something like

  • 0

I have a c# source file. Is there any way to put something like #!/usr/bin/env mono, so it will be compiled and then run as executable:

For python for example, i’ll do like this:

#!/usr/bin/env python

In fact, what I want is to run the script without calling “mono the.exe”, after compiling. I want something like “./the.exe”.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T04:06:11+00:00Added an answer on May 18, 2026 at 4:06 am

    EDIT: I just noticed you want to do this for a single source file—for a single source file. This is almost supported by the csharp REPL that ships with Mono. However, the REPL spits out a syntax error because it doesn’t understand the shebang line and sees it as a preprocessor definition. If I misunderstood and you were talking about a compiled assembly, the below text still applies. /EDIT

    You can’t use shebangs, because .exe files produced by Mono are PE executables, just like on Windows. They contain CIL, not a script.

    What you can do though is produce a small shell script that runs mono your.exe and use that, or you can use the Linux kernel’s binfmts support, as outlined here.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have java source code in a text file. There has to be entered
I currently have a source file with two classes in it. I'd like to
I am running Cygwin Python version 2.5.2. I have a three-line source file, called
I have a source file where 2 features have been added. In order to
Suppose I have a source file open and I launch a shell. I can
Suppose I have a source file that is 18218 bytes. I open the file
Let's say I have a source file with many preprocessor directives. Is it possible
Referring here A is a precompiled Java class (I also have the source file)
My lua source file have a filename > 60 chars (with needful non absolute
I have a source XML file that is used to create C# files that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.