-
Notifications
You must be signed in to change notification settings - Fork 8
fix: Ensure test cases can run properly #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…ependency injection
Contributor
Author
|
Closing because the scheduler functionality is still work in progress |
Contributor
Author
System.InvalidOperationException: Unable to resolve service for type 'SwiftlyS2.Shared.Events.IEventSubscriber' while
attempting to activate 'SwiftlyS2.Core.Scheduler.SchedulerService'.
at ServiceCallSite[[]] Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.CreateArgumentCallSites(
ServiceIdentifier serviceIdentifier, Type implementationType, CallSiteChain callSiteChain, ParameterInfo[]
parameters, bool throwIfCallSiteNotFound)
at ConstructorCallSite Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.
CreateConstructorCallSite(ResultCache lifetime, ServiceIdentifier serviceIdentifier, Type implementationType,
CallSiteChain callSiteChain)
at ServiceCallSite Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.CreateExact(
ServiceDescriptor descriptor, ServiceIdentifier serviceIdentifier, CallSiteChain callSiteChain, int slot)
at ServiceCallSite Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.TryCreateExact(
ServiceDescriptor descriptor, ServiceIdentifier serviceIdentifier, CallSiteChain callSiteChain, int slot)
at ServiceCallSite Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.TryCreateExact(
ServiceIdentifier serviceIdentifier, CallSiteChain callSiteChain)
at ServiceCallSite Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.CreateCallSite(
ServiceIdentifier serviceIdentifier, CallSiteChain callSiteChain)
at ServiceCallSite Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.GetCallSite(
ServiceIdentifier serviceIdentifier, CallSiteChain callSiteChain)
at ServiceAccessor Microsoft.Extensions.DependencyInjection.ServiceProvider.CreateServiceAccessor(ServiceIdentifier
serviceIdentifier)
at TValue System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func<TKey, TValue> valueFactory)
at object Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(ServiceIdentifier serviceIdentifier,
ServiceProviderEngineScope serviceProviderEngineScope)
at object Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(Type serviceType)
at object Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(
IServiceProvider provider, Type serviceType)
at T Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService<T>(IServiceProvider
provider)
at SwiftlyS2.Core.Services.SwiftlyCore..ctor(string contextId, string contextBaseDirectory, Type contextType,
IServiceProvider coreProvider) in D:\Github\swiftlys2\managed\src\SwiftlyS2.Core\Modules\Plugins\SwiftlyCore.cs:103
at PluginContext SwiftlyS2.Core.Plugins.PluginManager.LoadPlugin(string dir) in
D:\Github\swiftlys2\managed\src\SwiftlyS2.Core\Modules\Plugins\PluginManager.cs:163
at void SwiftlyS2.Core.Plugins.PluginManager.LoadPlugins() in
D:\Github\swiftlys2\managed\src\SwiftlyS2.Core\Modules\Plugins\PluginManager.cs:75
System.InvalidOperationException: Unable to resolve service for type 'SwiftlyS2.Shared.Events.IEventSubscriber' while
attempting to activate 'SwiftlyS2.Core.Scheduler.SchedulerService'.
at ServiceCallSite[[]] Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.CreateArgumentCallSites(
ServiceIdentifier serviceIdentifier, Type implementationType, CallSiteChain callSiteChain, ParameterInfo[]
parameters, bool throwIfCallSiteNotFound)
at ConstructorCallSite Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.
CreateConstructorCallSite(ResultCache lifetime, ServiceIdentifier serviceIdentifier, Type implementationType,
CallSiteChain callSiteChain)
at ServiceCallSite Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.CreateExact(
ServiceDescriptor descriptor, ServiceIdentifier serviceIdentifier, CallSiteChain callSiteChain, int slot)
at ServiceCallSite Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.TryCreateExact(
ServiceDescriptor descriptor, ServiceIdentifier serviceIdentifier, CallSiteChain callSiteChain, int slot)
at ServiceCallSite Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.TryCreateExact(
ServiceIdentifier serviceIdentifier, CallSiteChain callSiteChain)
at ServiceCallSite Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.CreateCallSite(
ServiceIdentifier serviceIdentifier, CallSiteChain callSiteChain)
at ServiceCallSite Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.GetCallSite(
ServiceIdentifier serviceIdentifier, CallSiteChain callSiteChain)
at ServiceAccessor Microsoft.Extensions.DependencyInjection.ServiceProvider.CreateServiceAccessor(ServiceIdentifier
serviceIdentifier)
at TValue System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func<TKey, TValue> valueFactory)
at object Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(ServiceIdentifier serviceIdentifier,
ServiceProviderEngineScope serviceProviderEngineScope)
at object Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(Type serviceType)
at object Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(
IServiceProvider provider, Type serviceType)
at T Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService<T>(IServiceProvider
provider)
at SwiftlyS2.Core.Services.SwiftlyCore..ctor(string contextId, string contextBaseDirectory, Type contextType,
IServiceProvider coreProvider) in D:\Github\swiftlys2\managed\src\SwiftlyS2.Core\Modules\Plugins\SwiftlyCore.cs:103
at SwiftlyCore SwiftlyS2.Core.Bootstrap.<>c__DisplayClass0_0.<Start>b__0(IServiceProvider provider) in
D:\Github\swiftlys2\managed\src\SwiftlyS2.Core\Bootstrap.cs:34
at object Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitFactory(FactoryCallSite
factoryCallSite, RuntimeResolverContext context)
at TResult Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite
callSite, TArgument argument)
at object Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(
ServiceCallSite callSite, RuntimeResolverContext context)
at TResult Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite
callSite, TArgument argument)
at object Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(
ConstructorCallSite constructorCallSite, RuntimeResolverContext context)
at TResult Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite
callSite, TArgument argument)
at object Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(
ServiceCallSite callSite, RuntimeResolverContext context)
at TResult Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite
callSite, TArgument argument)
at object Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.Resolve(ServiceCallSite
callSite, ServiceProviderEngineScope scope)
at ServiceAccessor Microsoft.Extensions.DependencyInjection.ServiceProvider.CreateServiceAccessor(ServiceIdentifier
serviceIdentifier)
at TValue System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func<TKey, TValue> valueFactory)
at object Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(ServiceIdentifier serviceIdentifier,
ServiceProviderEngineScope serviceProviderEngineScope)
at object Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(Type serviceType)
at object Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(
IServiceProvider provider, Type serviceType)
at T Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService<T>(IServiceProvider
provider)
at void SwiftlyS2.Core.Hosting.TestServiceInjection.UseTestService(IServiceProvider self) in
D:\Github\swiftlys2\managed\src\SwiftlyS2.Core\Hosting\TestServiceInjection.cs:15
at void SwiftlyS2.Core.Bootstrap.Start(IntPtr nativeTable, int nativeTableSize, string basePath) in
D:\Github\swiftlys2\managed\src\SwiftlyS2.Core\Bootstrap.cs:44
at void SwiftlyS2.Entrypoint.Start(IntPtr nativeTable, int nativeTableSize, IntPtr basePath) in
D:\Github\swiftlys2\managed\src\Entrypoint.cs:15
@skuzzis |
Member
|
Logically yeah, but i'm not receiving that error either, which is strange. |
samyycX
added a commit
that referenced
this pull request
Oct 1, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.

Description
This pull request implements the
AddTimermethod in theISchedulerServiceinterface and fixes dependency injection issues in the plugin system. The changes enable plugins to use a simplified timer API and resolve runtime configuration generation for .NET hosting.Type of Change
Please delete options that are not relevant.
Related Issues
Related to plugin timer functionality and dependency injection issues.
Changes Made
Detailed Changes
List the specific changes made:
AddTimer(int delayTick, Action task)method toISchedulerServiceinterfaceAddTimermethod inSchedulerServiceclass with proper timer lifecycle managementEventSubscriberasIEventSubscriberinterfaceGenerateRuntimeConfigurationFilesto project configuration for proper .NET runtime config generationTesting
Test Environment
Test Cases
Describe the test cases you've run:
Core.Scheduler.AddTimer(10, () => {...})Breaking Changes
List any breaking changes and migration steps:
Performance Impact
Details: The changes only add new functionality without modifying existing timer mechanisms.
Checklist
Screenshots/Videos (if applicable)
Additional Notes
AddTimermethod provides a simplified interface for one-time delayed execution timersSchedulerServicerequiredIEventSubscriberbut registration was incompleteSwiftlyS2.runtimeconfig.jsonrequired for .NET hostingFor Maintainers