JesCads
Posts: 5
Joined: Sun Mar 22, 2020 11:45 pm

Mono shows code as incorrect

Fri Mar 27, 2020 12:09 am

I have the problem that I cannot write working code in mono. The IDE always shows me an error. Even the default "Hello World" program is displayed as false.

Here is a picture of the "wrong" code: klick

To me it looks like some libraries are missing. But all of my software is up to date and Ive installed Mono as described on the official website. If someone has a solution, I would be grateful.

User avatar
DougieLawson
Posts: 37570
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: Mono shows code as incorrect

Fri Mar 27, 2020 7:40 am

I don't think your photo shows what you think it's showing.
Image
Doesn't appear to have anything wrong with it to me apart from some missing USINGs.

Code: Select all

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp1
{
    class Program
    {
    static void Main(string[] args)
    {
        Console.WriteLine("Hello, world!");
        Console.ReadLine();
    }
    }
}
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

JesCads
Posts: 5
Joined: Sun Mar 22, 2020 11:45 pm

Re: Mono shows code as incorrect

Fri Mar 27, 2020 6:24 pm

DougieLawson wrote:
Fri Mar 27, 2020 7:40 am
I don't think your photo shows what you think it's showing.
Image
Doesn't appear to have anything wrong with it to me apart from some missing USINGs.

Code: Select all

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp1
{
    class Program
    {
    static void Main(string[] args)
    {
        Console.WriteLine("Hello, world!");
        Console.ReadLine();
    }
    }
}
Thats what I thought. But on my PC I can write a simple "Hello World program" by only using System and nothing else. I still added all your namespaces. However, it still does not work. The namespaces Linq and System.Text could not even be found. When I hover over the string "Hello World!" for example, MonoDevelop shows me "Predefined type 'System.String' is not defined or imported. Iam also unable to add the namespace System.String it does not exist. I think I need to reinstall my pi or MonoDevelop.

User avatar
DougieLawson
Posts: 37570
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: Mono shows code as incorrect

Fri Mar 27, 2020 8:28 pm

You're going to need to post your problem on https://www.mono-project.com/community/ as there aren't enough folks on here who've ever installed & run Mono.

I did for an article in Magpi magazine issue 30 https://magpi.raspberrypi.org/issues/30/pdf as I was testing the code on page 26 before it got published. That was when I got my BMP180 temp & pressure sensor that has now saved me more than £400 in fuel bills.
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

JesCads
Posts: 5
Joined: Sun Mar 22, 2020 11:45 pm

Re: Mono shows code as incorrect

Sat Mar 28, 2020 1:19 am

DougieLawson wrote:
Fri Mar 27, 2020 8:28 pm
You're going to need to post your problem on https://www.mono-project.com/community/ as there aren't enough folks on here who've ever installed & run Mono.

I did for an article in Magpi magazine issue 30 https://magpi.raspberrypi.org/issues/30/pdf as I was testing the code on page 26 before it got published. That was when I got my BMP180 temp & pressure sensor that has now saved me more than £400 in fuel bills.
Im gonna go check out the Mono Community. Let me take a look at your article as well. Anyway thanks for your help. I appreciate it.

User avatar
DougieLawson
Posts: 37570
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: Mono shows code as incorrect

Sat Mar 28, 2020 2:09 am

JesCads wrote:
Sat Mar 28, 2020 1:19 am
DougieLawson wrote:
Fri Mar 27, 2020 8:28 pm
You're going to need to post your problem on https://www.mono-project.com/community/ as there aren't enough folks on here who've ever installed & run Mono.

I did for an article in Magpi magazine issue 30 https://magpi.raspberrypi.org/issues/30/pdf as I was testing the code on page 26 before it got published. That was when I got my BMP180 temp & pressure sensor that has now saved me more than £400 in fuel bills.
Im gonna go check out the Mono Community. Let me take a look at your article as well. Anyway thanks for your help. I appreciate it.
It's not my article, I only tested the code and edited it for publication.
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

Return to “Other programming languages”