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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T07:54:14+00:00 2026-05-29T07:54:14+00:00

I am currently using the DotSpatial library for .NET (GIS Library). I am getting

  • 0

I am currently using the DotSpatial library for .NET (GIS Library). I am getting an error within my AppManager class. The AppManager is a Component that manages the loading of extensions (including data providers), and helps with file serialization:

Code being flagged at foreach

public IEnumerable<string> GetDirectoriesNestedOneLevel()
{
       // Visit each directory in Directories Property (usually set by application)
    foreach (string directory in Directories.Union(new[] { "Data Extensions", "Tools" }))
    {
        string path = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, directory);

        if (Directory.Exists(path))
        {
            yield return path;

            // Add all of the directories in here, nested one level deep.
            var dirs = Directory.EnumerateDirectories(path, "*", SearchOption.TopDirectoryOnly);

            foreach (var dir in dirs)
            {
                yield return dir;
            }
        }
    }
}

ParamName

first

Source

System.Core

StackTrace

at System.Linq.Enumerable.Union[TSource](IEnumerable1 first, IEnumerable1 second) at
DotSpatial.Controls.AppManager.d__9.MoveNext()
in c:\dev\DotSpatial\DotSpatial.Controls\Extensions\AppManager.cs:line
581 at DotSpatial.Controls.AppManager.GetCatalog() in
c:\dev\DotSpatial\DotSpatial.Controls\Extensions\AppManager.cs:line
563 at DotSpatial.Controls.AppManager.LoadExtensions() in
c:\dev\DotSpatial\DotSpatial.Controls\Extensions\AppManager.cs:line
329 at DemoMap.MainForm..ctor() in C:\Users\Logan B.
Lehman\Documents\DemoMap\DemoMap\MainForm.cs:line 230 at
DemoMap.Program.Main() in C:\Users\Logan B.
Lehman\Documents\DemoMap\DemoMap\Program.cs:line 13 at
System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[]
args) at System.AppDomain.ExecuteAssembly(String assemblyFile,
Evidence assemblySecurity, String[] args) at
Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext
executionContext, ContextCallback callback, Object state, Boolean
ignoreSyncCtx) at
System.Threading.ExecutionContext.Run(ExecutionContext
executionContext, ContextCallback callback, Object state) at
System.Threading.ThreadHelper.ThreadStart()

Any idea on what is going on here? *It would be more than appreciated*

  • 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-29T07:54:15+00:00Added an answer on May 29, 2026 at 7:54 am

    My guess would be that ‘Directories’ is null. It’s not clear from the code snippet where that should be set, but in this case it is not being set. The error is a little cryptic because of the way Union is implemented: it is an extension method, so behind the scenes the actual call is:

    IEnumerableExtensions.Union(IEnumerable first, IEnumerable second)
    

    Depending on what Directories is, one quick fix would be, before the foreach:

    if (Directories == null) { Directories = new List<string>().ToArray(); }
    

    Another possibility would be something like:

    var allDirs = new List<string>();
    if (Directories != null) { allDirs.AddRange(Directories);}
    allDirs.AddRange(new[]{ "Data Extensions", "Tools" });
    foreach(string directory in allDirs)
    

    But a better fix would be to go to the code that sets directories and make sure it’s always setting a value…

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

Sidebar

Related Questions

Currently using the HTTPServletRequest class and specifically the .getQueryString method to retrieve an inputted
Im currently using vs2008 with asp.net mvc framework for web development. Im missing a
I'm currently using VS2005 Profesional and .NET 2.0, and since our project is rather
Currently using Telerik ASP .NET MVC Controls version 2011.2.712 Hello all, I am trying
im currently using the SDL-devel-1.2.13-mingw32 library in code blocks 8.02. with the mingw 5.1.6
Im currently using CodeIgniters active record class to UPDATE a MySQL table. One of
Im currently using base64_encode for some $_GET params that i don't want regular user
I am currently using the contains method belonging to the ArrayList class for making
Im currently using a method that looks like the following code to add script
Im currently using the Barcode Scanner from the open source library Zxing in my

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.