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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T12:25:04+00:00 2026-05-30T12:25:04+00:00

This method is part of a class called OSVersion. When I test this in

  • 0

This method is part of a class called OSVersion. When I test this in a console application though it works fine. Count does not exist in the current context. Can anyone shed some light on this please.

public static bool  OperatingSystemVersionGet()
        {
            XmlDocument xlDoc = new XmlDocument();
            string sfile =
                @"C:\dev\4.6\RTM\R1\Install\SetupManager\SourceCode.SetupManager\SourceCode.SetupManager\Configs\blackpearl\Product.config";

            xlDoc.Load(sfile);
            XmlNodeList nodeList = xlDoc.SelectNodes("//dependancy");

            List<string> compareList = new List<string>();

            string osv = Environment.OSVersion.VersionString;

            int firstIndex = osv.IndexOf(' ');
            int secondIndex = osv.IndexOf(' ', firstIndex + 1);
            int thirdIndex = osv.IndexOf(' ', secondIndex + 1);

            String osName = osv.Substring(0, thirdIndex);
            String majorVersion = osv.Substring(thirdIndex + 1, 1);
            String minorVersion = osv.Substring(thirdIndex + 3, 1);

            bool isIn = false;

            if (nodeList != null)
                foreach (XmlNode node in nodeList)
                {
                    try
                    {

                            string type = node.Attributes["type"].Value;
                            string name = node.Attributes["name"].Value;
                            string feat = node.Attributes["featureversion"].Value;

                            String[] versionPart = feat.Split('.');

                            string second = versionPart[1];
                            string third = versionPart[2];

                                if (type == "Windows")
                                {
                                    if((name == osName) && ((second == majorVersion) && (third == minorVersion)))
                                    {
                                        compareList.Add(name);
                                    }

                                }


                    }
                    catch(NullReferenceException ex)
                    {
                        //nullReferenceException handled here
                    }
                }

           if(compareList.Count == 0)
            {
                isIn = true;
            }
            else
            {
                isIn = false;
            }
            return isIn;

        }
  • 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-30T12:25:06+00:00Added an answer on May 30, 2026 at 12:25 pm

    you say that you receive this in compile time

    try to clean your solution and rebuild it .

    I can’t see any error and I made a copy of your function in my current project and I compile it without error !

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

Sidebar

Related Questions

New Details: Repaint method of my JPanel object does not work when called from
I'd like to remove all unchecked warnings from this general utility method (part of
This method works as expected - it creates a JTree with a root node
In Restlet you have a class called SecretVerifier with an abstract method verify(String identifier,
I have this Person class that is part of various other transactions like a
With this method declaration (no overloads): void Method(double d) { // do something with
Take this method /** * @return List of group IDs the person belongs to
Can this method work? public String sayHello(){ return Hello.jsp?name= + laala; } I am
I have this method on a webpart: private IFilterData _filterData = null; [ConnectionConsumer(Filter Data
Every time I call this method my NSMutableData is leaking and I cannot figure

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.