Skip to content

fix(hotfix): skip CrestronOnvif.dll during assembly scanning at startup#1389

Merged
andrew-welker merged 3 commits intomainfrom
copilot/fix-crestrononvif-dll-error
Mar 3, 2026
Merged

fix(hotfix): skip CrestronOnvif.dll during assembly scanning at startup#1389
andrew-welker merged 3 commits intomainfrom
copilot/fix-crestrononvif-dll-error

Conversation

Copy link
Contributor

Copilot AI commented Mar 1, 2026

CrestronOnvif.dll is a Crestron-provided assembly that produces a spurious Invalid Image error on every Essentials startup when the program directory is scanned for device factories.

Changes

  • DeviceFactory.cs: Introduced a assembliesToSkip list checked before each Assembly.LoadFrom() call; CrestronOnvif.dll is the first entry. Skipped assemblies emit a Verbose-level log instead of an error.
// Assemblies known to cause load errors that should be skipped
var assembliesToSkip = new[] { "CrestronOnvif.dll" };

foreach (var assembly in programAssemblies)
{
    if (assembliesToSkip.Any(a => Path.GetFileName(assembly).Equals(a, StringComparison.OrdinalIgnoreCase)))
    {
        Debug.LogMessage(LogEventLevel.Verbose, "Skipping assembly: {assemblyName}", null, assembly);
        continue;
    }
    // ...
}

The skip list is easily extensible if additional problematic Crestron assemblies are identified in the future.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • crl.entrust.net
    • Triggering command: /usr/bin/dotnet dotnet restore --no-dependencies /home/REDACTED/work/Essentials/Essentials/PepperDash.Essentials.4Series.sln --packages /tmp/codeql-scratch-34409fe8f58e31ec/dbs/csharp/working/packages /p:DisableImplicitNuGetFallbackFolder=true --verbosity normal /p:TargetFrameworkRootPath=/tmp/codeql-scratch-34409fe8f58e31ec/dbs/csharp/working/emptyFakeDotnetRoot /p:NetCoreTargetingPackRoot=/tmp/codeql-scratch-34409fe8f58e31ec/dbs/csharp/working/emptyFakeDotnetRoot /p:AllowMissingPrunePackageData=true (dns block)
    • Triggering command: /usr/bin/dotnet dotnet restore --no-dependencies /tmp/codeql-scratch-34409fe8f58e31ec/dbs/csharp/working/8E3C38744AF97AEA71D98A0334D7EC97/missingpackages_workingdir --packages /tmp/codeql-scratch-34409fe8f58e31ec/dbs/csharp/working/missingpackages /p:DisableImplicitNuGetFallbackFolder=true --verbosity normal --configfile /tmp/codeql-scratch-34409fe8f58e31ec/dbs/csharp/working/nugetconfig/nuget.config --force (dns block)
  • ocsp.entrust.net
    • Triggering command: /usr/bin/dotnet dotnet restore --no-dependencies /home/REDACTED/work/Essentials/Essentials/PepperDash.Essentials.4Series.sln --packages /tmp/codeql-scratch-34409fe8f58e31ec/dbs/csharp/working/packages /p:DisableImplicitNuGetFallbackFolder=true --verbosity normal /p:TargetFrameworkRootPath=/tmp/codeql-scratch-34409fe8f58e31ec/dbs/csharp/working/emptyFakeDotnetRoot /p:NetCoreTargetingPackRoot=/tmp/codeql-scratch-34409fe8f58e31ec/dbs/csharp/working/emptyFakeDotnetRoot /p:AllowMissingPrunePackageData=true (dns block)
    • Triggering command: /usr/bin/dotnet dotnet restore --no-dependencies /tmp/codeql-scratch-34409fe8f58e31ec/dbs/csharp/working/8E3C38744AF97AEA71D98A0334D7EC97/missingpackages_workingdir --packages /tmp/codeql-scratch-34409fe8f58e31ec/dbs/csharp/working/missingpackages /p:DisableImplicitNuGetFallbackFolder=true --verbosity normal --configfile /tmp/codeql-scratch-34409fe8f58e31ec/dbs/csharp/working/nugetconfig/nuget.config --force (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>[BUG]-CrestronOnvif.dll Invalid Image</issue_title>
<issue_description>Was this bug identified in a specific build version?
2.21.0

Describe the bug
A clear and concise description of what the bug is.
CrestronOnvif.dll is reporting an Invalid Image when Essentials starts. This has been happening for a while, but is more an annoyance and has not seemed to impact system performance.
Error reports regardless of config loaded.

Stacktrace

[2025-12-04 10:23:11.984][EROR][App 1] Unable to load assembly: /simpl/app01/CrestronOnvif.dll - Invalid Image

Essentials Version: 2.21.0
PepperDash Core Version: 2.21.0
Essentials Plugin Versions:
epi-vytio-iptv.4series Version: 0.6.0
KpmgRoom Version: 1.10.2
epi-videoCodec-ciscoExtended.4Series Version: 2.4.0
PepperDash.Essentials.DM Version: 1.5.4
epi-nanolumens-hseries.4Series Version: 1.1.0
epi-crestron-io.4Series Version: 2.1.1
epi-cisco-cli.4Series Version: 1.4.2
epi-display-samsung-mdc.4Series Version: 1.5.2
epi.analogWay.aquilon.4series Version: 1.3.1-cleanup-logging.1
Tesira-DSP-EPI.4Series Version: 3.3.0
epi-lutron-leap.4Series Version: 1.0.2
NvxEpi.4Series Version: 3.10.2

To Reproduce
Steps to reproduce the behavior:

  1. Install Essentials
  2. Monitor console at Error Level
  3. See Error reported

Expected behavior
No error is expected.

Screenshots
NA

Additional context
NA
</issue_description>

<agent_instructions>when scanning assemblies at startup, we should skip attempting to load this particular assembly, tag the fix with a semantic hotfix</agent_instructions>

Comments on the Issue (you are @copilot in this section)

@andrew-welker All the DLLs in the program folder are scanned when Essentials starts up to find devices/factories. This one is a Crestron-provided DLL that is loaded from the Crestron nuget packages. We can probably add something that filters this specific assembly out so the error message doesn't show up anymore.

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: ngenovese11 <23391587+ngenovese11@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix CrestronOnvif.dll Invalid Image error fix(hotfix): skip CrestronOnvif.dll during assembly scanning at startup Mar 1, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This hotfix prevents Essentials startup logs from being spammed by a known-bad Crestron-provided assembly (CrestronOnvif.dll) during the program-directory assembly scan used for device factory discovery.

Changes:

  • Adds a small skip list to bypass loading CrestronOnvif.dll during startup DLL scanning.
  • Logs skipped assemblies at Verbose level rather than emitting an error due to load failure.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@ngenovese11 ngenovese11 marked this pull request as ready for review March 3, 2026 17:35
@ngenovese11
Copy link
Contributor

@andrew-welker @ndorin this fix has been verified functional in the field, have a look at your leisure

@ngenovese11 ngenovese11 requested a review from ndorin March 3, 2026 17:36
@andrew-welker andrew-welker merged commit b64f63a into main Mar 3, 2026
2 checks passed
@andrew-welker andrew-welker deleted the copilot/fix-crestrononvif-dll-error branch March 3, 2026 17:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG]-CrestronOnvif.dll Invalid Image

4 participants