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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T03:33:27+00:00 2026-05-22T03:33:27+00:00

class Program { static string path = C:\\Work\\6.70_Extensions\\NightlyBuild\\; static void Main(string[] args) { var

  • 0
class Program
{
    static string path = "C:\\Work\\6.70_Extensions\\NightlyBuild\\";

    static void Main(string[] args)
    {
        var di = new DirectoryInfo("C:\\Work\\6.70_Extensions\\NightlyBuild");

        foreach (var file in di.GetFiles("*", SearchOption.AllDirectories))
            file.Attributes &= ~FileAttributes.ReadOnly;

        var files = Directory.GetDirectories(path, "SASE Lab Tools.*");
        foreach(var file in files)
        Console.WriteLine(file);
        foreach(var file in files.OrderByDescending(x=>x).Skip(7))
        Console.WriteLine(file);
        foreach(var file in files.OrderByDescending(x=>x).Skip(7))
        Directory.Delete(file);
    }
}

The above is my code which i complied in VS2008 .net version 3.5. However, when i transfer this to another machine with .net version 3.0, an error occured even under the same environment.

Error:

Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly 'System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. The system cannot find the file specified.

I do not have VS2008 installed on that machine and i was wondering if my code has something to do with the error? I tried to go to msdn and researched on Directory.GetDirectories(string, Searchpattern) and only this appeared for the 3.5

  • 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-22T03:33:27+00:00Added an answer on May 22, 2026 at 3:33 am

    It’s failing as v3.5 of the framework is not installed, and your executable references assemblies that are included with it to support the LINQ query in that snippet. Either install v3.5 of the framework (or later) or change your application to target a lower version of the framework (which would mean you’d have to rewrite your LINQ query as “normal” code)

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

Sidebar

Related Questions

class Program { static void Main(string[] args) { List<Book> books = new List<Book> {
I have the following code: class Program { static void Main(string[] args) { new
class Program { static void Main(string[] args) { String value = Two; Type enumType
Consider the following code: class Program { static void Main(string[] args) { Department deathStar
Take the following useless program: class Program { static void Main(string[] args) { IUnityContainer
I am trying to do the following: class Program { static void Main(string[] args)
In C#, I can do this: class Program { static void Main(string[] args) {
class Program { internal delegate int CallBack(int i); static void Main(string[] args) { CallBack
I have a little console C# program like Class Program { static void main(string
ConsoleApplication: class Program { static void Main() { using (var runSpace = RunspaceFactory.CreateRunspace()) {

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.