Skip to content

[BUG]: Unable to run DevProxy with RateLimitingPlugin due to unhandled exception #1330

@bartizan

Description

@bartizan

Description

Unable to run DevProxy with RateLimitingPlugin due to an unhandled exception.

Unhandled exception. System.InvalidOperationException: Unable to resolve service for type 'Microsoft.Extensions.Logging.ILogger' while attempting to activate 'DevProxy.Plugins.Behavior.RateLimitingPlugin'.
   at Microsoft.Extensions.DependencyInjection.ActivatorUtilities.ConstructorMatcher.CreateInstance(IServiceProvider provider)
   at Microsoft.Extensions.DependencyInjection.ActivatorUtilities.CreateInstance(IServiceProvider provider, Type instanceType, Object[] parameters)
   at Microsoft.Extensions.DependencyInjection.PluginServiceExtensions.<>c__DisplayClass1_0.<RegisterPlugin>b__2(IServiceProvider sp) in X:\DP\DevProxy\Plugins\PluginServiceExtensions.cs:line 188
...

It happens for a few plugins:

  • RateLimitingPlugin;
  • ApiCenterMinimalPermissionsPlugin.

Expected behaviour

DevProxy is up and running

Actual behaviour

Fails with an exception

Steps to reproduce

try to start DevProxy

Dev Proxy Version

v1.0.0-beta.6

Operating system (environment)

Windows

Shell

PowerShell

Configuration file

{
  "$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v0.29.2/rc.schema.json",
  "plugins": [
    {
      "name": "RateLimitingPlugin",
      "enabled": true,
      "pluginPath": "~appFolder/plugins/DevProxy.Plugins.dll",
      "configSection": "rateLimiting"
    }
  ],
  "urlsToWatch": [
    "https://myapi.net/*"
  ],
  "rateLimiting": {
    "$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v0.29.2/ratelimitingplugin.schema.json",
    "costPerRequest": 1,
    "resetTimeWindowSeconds": 90,
    "warningThresholdPercent": 0,
    "rateLimit": 3
  }
}

Additional Info

No response

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions