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

  • Home
  • SEARCH
  • 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 4592480
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T22:32:43+00:00 2026-05-21T22:32:43+00:00

This is, as I understand it, the absolutely minimal MVC application its possible to

  • 0

This is, as I understand it, the absolutely minimal MVC application its possible to have:

using System;
using System.Web;
using System.Web.Mvc;
using System.Web.Mvc.Ajax;
public class HomeController : Controller {
  public string Index() {
    return "Hello World";
  }
}

My question is, without visual studio, or mono develop, how do you build this application on linux?

I personally, am running ubuntu; I expected to be able to do this via:

gmcs hello.cs

But that gives the error:

The type or namespace name `Mvc' does not exist in the namespace `System.Web'. Are you missing an assembly reference?

What? How do I get this required assembly? How do I depend on it?

I’ve been looking for an answer to this all day and I’ve seen solutions to this question that fall into four broad categories:

1) Put system.web.mvc.dll in a ‘bin’ folder and build it.

That didn’t seem to do anything.

2) Compile the magical .sln file that visual studio created with xbuild.

I don’t have one of those, or a copy of visual studio.

3) You don’t need to compile web apps you just set the server up and it works.

No idea. I tried using xsp2 and creating a web.config is it just 404’d on localhost. I think this is just incorrect.

4) You need to compile mono from source for this to work.

I’m running 2.4 which is the std. ubuntu package; from the comments I’ve seen this should be sufficient?

So, how do you actually do this?

—

None of the solutions below (as of writing) actually had a final answer for this, but I’ve accepted one of them that pointed me in the correct direction.

To build the minimal MVC application (above) on ubuntu, I had to do the following:

apt-get install mono-2.0-devel
gmcs /out:bin/out.dll /target:module /reference:/usr/lib/mono/2.0/System.Web.Mvc.dll hello.cs

😀

  • 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-21T22:32:44+00:00Added an answer on May 21, 2026 at 10:32 pm

    In your example above you do not tell the compiler about any other library references you require. Thats why it fails with the message about missing references.

    You tell gmcs and other compilers about other references with the following syntax:

    $ gmcs /reference:path/to/my/assembly.dll /target:library path/to/my/csharp.cs
    

    If you write your application in monodevelop or visual studio you can still build the solution without needing to load it up. You can do this using msbuild (on windows).

    On linux you get a choice of using xbuild or mdtool. You will usually have mdtool if you also have monodevelop installed. xbuild is the mono equivalent of msbuild and will work just the same for most projects.

    Monodevelop has the added advantage that you can get it to generate Makefiles so that your solution can be built in a more linux/unix way by running autotools and gnu make.

    To tackle the problem in the last way you choose ‘enable makefile integration for this project’ when looking at the project properties in monodevelop. You will want to do this for all projects in your solution that you need.

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

Sidebar

Related Questions

I cannot understand how this is possible. Please help!! I have an app with
If I understand this correctly: Current CPU developing companies like AMD and Intel have
Lutz Roeder's Reflector, that is. Its obfuscated. I still don't understand this. Can somebody
While I understand this question is fairly vague since I'm not giving you all
I'm trying to understand this bit of code: in display.php: <html> ... <body> <table>
I would like to know this to understand why some games like Mario is
I'm confused with how views are organized, and it is important to understand this
I don't know much about database optimization, but I'm trying to understand this case.
I fail to understand why this code won't compile ExecutorService executor = new ScheduledThreadPoolExecutor(threads);
I'm trying to understand why this does not work. (Basic example with no validation

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.