# I'm Having An Issue With Mono About A Newline That Isn't There



## RedPhoenix (Jun 24, 2019)

Hey guys.  I come to you because I've tested this Program written in C# elsewhere with Mono, and it seems to be the FreeBSD Mono implementation. Why, I'm not certain... Anyway, it's a pretty short question, and one that may involve me Compiling Mono by Source.  First, the Code, which is Open Source...



```
// Using statements to import classes
using System;
using System.IO;
using System.Threading;

// namespace
namespace Pill_Prompt

{     
    // class definition
    public class Pill_Popper_Prompt

    {
        // private data members
        private String list_of_meds;

        private int number_of_meds;

        private String med_schedule;
      
        // public constructor
        public Pill_Popper_Prompt()

        {
            Console.WriteLine("Welcome to Pill Popper! The pill manager that aims to help in the dispensation of your medication!\n");
            Console.Write("Now then... Begin by entering the amount of meds you are currently prescibed >>>");
            number_of_meds = Convert.ToInt32(Console.ReadLine());

        }

        // Public accessor for list_of_meds
        public int Get_Number_Of_Meds()

        {
            return number_of_meds;

        }
      
        // Rest of accessors go here
        // etc.
        // likewise any public setters/mutators for class members
    }
} // end namespace PillPrompt

namespace Pill_Popper_Main

{
    public class Pill_Popper

    {
        static void Main()
        
        {


        } 
    }
}
```

Now, as you can probably guess,  Mono will normally only generate warnings for unused items (Variables, Classes, Methods, etc..)... However, running `mcs` on FreeBSD 12 generates an error about an "unexpected Symbol" on line 27, but..... Wait, never mind, for some reason, it works now. I'll leave it up to the Mods to remove or keep this post up here.  Ah, Programming:


----------



## aragats (Jun 25, 2019)

RedPhoenix said:


> Program written in C# elsewhere with Mono, and it seems to be the FreeBSD Mono implementation.


FreeBSD is using mainline Mono, although it's slightly outdated: we have mono 5.10, the official release is 5.20. The corresponding patches for 5.20 are already submitted, hopefully will be updated soon. There are many moving parts in Mono, its behaviour may slightly change with every release.
I'm running a complex C# server software for months (although compiled in Windows), perfectly works in FreeBSD.


----------



## RedPhoenix (Jun 27, 2019)

aragats said:


> FreeBSD is using mainline Mono, although it's slightly outdated: we have mono 5.10, the official release is 5.20. The corresponding patches for 5.20 are already submitted, hopefully will be updated soon. There are many moving parts in Mono, its behaviour may slightly change with every release.
> I'm running a complex C# server software for months (although compiled in Windows), perfectly works in FreeBSD.


Yeah, something told me it was that. :\ But my Code works now, so I'm not complaining.  But a C# Server... Sounds like fun! :> Thank you for the reply, good sir!


----------



## reddy (Jul 3, 2019)

Also, keep in mind that mcs is the compiler developped by the mono team and it is sometimes behind in terms of C# version support (even though it also has interesting innovations in terms of compiling tools). For example C# version 7 support was partial last time I check.

If you do not have any specific reason to use mcs, you may want to use roslyn instead, which is Microsoft's sponsored and open-source compiler that is now bundled with mono (and has been for already quite some time now). This will allow you to use cutting-edge C# features and syntax.


----------



## RedPhoenix (Jul 6, 2019)

reddy said:


> Also, keep in mind that mcs is the compiler developped by the mono team and it is sometimes behind in terms of C# version support (even though it also has interesting innovations in terms of compiling tools). For example C# version 7 support was partial last time I check.
> 
> If you do not have any specific reason to use mcs, you may want to use roslyn instead, which is Microsoft's sponsored and open-source compiler that is now bundled with mono (and has been for already quite some time now). This will allow you to use cutting-edge C# features and syntax.


Yeah, I tried Roslyn in Windows or Ubuntu I think.  It's supposed to be really good, and I want to keep up with current (and old) technologies.  I'll give it a go!  Thanks!


----------

