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

We have a fairly large code-base. The vast majority of the code is compiled
I'd like to create a GWT (2.0.4) project but with my source in a
I have a page on my ASP.NET site that has a Repeater control to
I am trying to insert some copy-right information into the beginning of some source
We all agree that using different exception types for different tasks is the way
I need to send the project files to my client for running it on
I'm impersonating a user until Windows 2008 with UAC enabled. I'm trying to write
Ok, so I'm writing some python code (I don't write python much, I'm more
I installed Mogenerator . Now what do I do? How do I use it?
I'm trying to create a distributable zip of my project that contains several configuration

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.