abpframework/abp · error · Exception

Module not found!

Error message

Module not found!

What it means

Thrown by `ModuleInfoProvider.GetAsync` when the module list fetched from abp.io does not contain an entry whose `Name` equals the requested module name. It is a raw `Exception`.

Source

Thrown at framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/ModuleInfoProvider.cs:41

        ICancellationTokenProvider cancellationTokenProvider,
        IRemoteServiceExceptionHandler remoteServiceExceptionHandler,
        CliHttpClientFactory cliHttpClientFactory)
    {
        JsonSerializer = jsonSerializer;
        CancellationTokenProvider = cancellationTokenProvider;
        RemoteServiceExceptionHandler = remoteServiceExceptionHandler;
        _cliHttpClientFactory = cliHttpClientFactory;
    }

    public async Task<ModuleInfo> GetAsync(string name)
    {
        var moduleList = await GetModuleListInternalAsync();

        var module = moduleList.FirstOrDefault(m => m.Name == name);

        if (module == null)
        {
            throw new Exception("Module not found!");
        }

        return module;
    }

    public async Task<List<ModuleInfo>> GetModuleListAsync()
    {
        return await GetModuleListInternalAsync();
    }

    private async Task<List<ModuleInfo>> GetModuleListInternalAsync()
    {
        var client = _cliHttpClientFactory.CreateClient();

        using (var responseMessage = await client.GetAsync(
            $"{CliUrls.WwwAbpIo}api/download/modules/",
            CancellationTokenProvider.Token
        ))

View on GitHub (pinned to 7ed43b1931)

Solutions

  1. List available modules (via `abp add-module` help or the abp.io module list) and use the exact name.
  2. Check casing and spelling of the module name argument.
  3. Ensure network connectivity so the full module list is fetched; retry on transient failures.

Example fix

# before
abp add-module Idenity
# after
abp add-module Identity
Defensive patterns

Strategy: validation

Validate before calling

var modules = await moduleInfoProvider.GetModuleListAsync();
if (!modules.Any(m => string.Equals(m.Name, name, StringComparison.OrdinalIgnoreCase)))
    throw new ArgumentException($"Module '{name}' not found. Available: {string.Join(", ", modules.Select(m => m.Name))}");

Type guard

static async Task<bool> ModuleExistsAsync(ModuleInfoProvider provider, string name)
{
    var list = await provider.GetModuleListAsync();
    return list.Any(m => string.Equals(m.Name, name, StringComparison.OrdinalIgnoreCase));
}

Try / catch

try { await moduleInfoProvider.GetAsync(name); }
catch (Exception ex) when (ex.Message == "Module not found!")
{
    logger.LogError("Module '{Name}' not found. Check spelling and license.", name);
    throw;
}

Prevention

When it happens

Trigger: Running `abp add-module <name>` (or the underlying provider) with a module name that is not in the remote module list — typo, wrong casing, or an unavailable/nonexistent module.

Common situations: Typo in the module name; using a commercial module name on a non-commercial account; module deprecated/renamed; network issue returning a partial list so the name is not found.

Related errors


AI-assisted analysis of abpframework/abp@7ed43b1931 (2026-08-13). Data as JSON: /api/errors/e08919ba1609476f. Report an issue: GitHub.