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 6889265
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T06:08:03+00:00 2026-05-27T06:08:03+00:00

I followed this thread to install Mono on my Fedora box: Install Mono on

  • 0

I followed this thread to install Mono on my Fedora box:

Install Mono on Centos 5.5 using YUM

However, when I try and compile my program using:

 gmcs foo.cs

I get:

  foo.cs(11,44): error CS0117: `System.IO.File' does not contain a definition for `ReadLines'
/opt/novell/mono/lib/mono/2.0/mscorlib.dll (Location of the symbol related to previous error)

Compilation failed: 1 error(s), 0 warnings

The line in question is:

 using System;
 using System.Collections.Generic;
 using System.IO;
 using System.Linq;

 foreach(int currentMax in File.ReadLines(args[0]).Select(int.Parse)) 
 {
     ...
 }

Can anyone point me in the right direction?

  • 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-27T06:08:04+00:00Added an answer on May 27, 2026 at 6:08 am

    So it looks like the problem is that you are using the gmcs compiler, which is designed specifically for targeting the .Net 2.0 runtime. The list of C# compilers for mono is:

    • mcs – .Net 1.1 runtime (deprecated)
    • gmcs – .Net 2.0 runtime
    • smcs – .Net 2.1 runtime
    • dmcs – .Net 4.0 runtime

    (see here for more details)

    So the compiler you should be using for targeting .Net 4.0 is dmcs. Instead, if you actually intended to target .Net 2.0, then use the File.ReadAllLines method that @kil and @minitech talked about.

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

Sidebar

Related Questions

I have followed this thread now when i try to build using maven plugin
I followed this tutorial http://stevejenkins.com/blog/2011/08/how-to-install-apc-alternative-php-cache-on-centos-5-6/ to install apc on my centos vps hosting but
This question is related to this previous thread . I followed Tomas's suggestion using
I mainly followed this thread: How do you add files to a jar using
I followed this thread: datepicker by clicking on textfield I imported both of the
I followed this tutorial . But whenever I try to log in with my
I followed this video tutorial for detecting memory leaks using Instruments with Xcode 4.3.2.
I followed this post http://neurochannels.blogspot.com/2010/05/how-to-run-r-code-in-matlab.html , to install R(D)Com server in order to call
I am merging some png files to a uiimage and I followed this thread
I've followed THIS thread to remove the border that surrounds the Gallery, but the

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.