5

Just installed MonoDevelop and I tried to compile a simple "Hello World". Code I used:

using System;

public class HelloWorld
{
    static public void Main ()
    {
        Console.WriteLine ("Hello Mono World");
    }
}

The error that I get is :

EmptyCSharpFile.csproj(1,1): Error: Unknown MSBuild failure. Please try building the project again (EmptyCSharpFile)

Error Message

My system info: Ubuntu 16.04 LTS , updated The MonoDevelop and mono are freshly installed. Mono JIT compiler version 5.0.1.1 MonoDevelop Version 5.10 I can use mcs and run it but can't use monodevelop to run it. I did read these similar topics but no response yet: MonoDevelop Failure "Unknown MSBuild Failure" on Linux ; C# compile Unknown MSBuild error MonoDevelop Linux ; https://askubuntu.com/questions/73630/could-not-obtain-c-compiler-error-when-using-monodevelop

  • Mono 5.x are latest, while MonoDevelop 5.x are too old. Please try to compile the project at terminal via msbuild command and see what exactly happens. – Lex Li Jun 06 '17 at 03:56
  • The problem is that you need to create a C# project, called a "Solution". Unlike with C++, individual `.cs` files can't be compiled and run. – Aaron Franke Mar 21 '18 at 02:33

1 Answers1

1

I too had the same problem when I first installed it , I assume you went straight to file -> new-> file-> general -> emptyc# file.

Instead of that, go to file->new-> solution from there choose Console C# project or simply press ctrl + shift + N choose next ,and give project name, by default the new project has a simple hello world program run it, this time it will work.(it worked for me)

Kishy Nivas
  • 663
  • 8
  • 21