postsharp / Metalama

Metalama is a Roslyn-based meta-programming framework. Use this repo to report bugs or ask questions.
181 stars 6 forks source link

Two users on a Windows Server can't use Metalama at the same time #365

Closed rtambun closed 1 month ago

rtambun commented 2 months ago

Environment Metalama.Framework Version: 2024.2.24 Runtime: .NET 8.0.401 OS: Windows Server 2016 IDE: Visual Studio Code

Issue Description When two user login to Windows Server and run following command in Visual Studio Code terminal, metalama license list or dotnet build, only one user can do that, i.e. the first one that run the command. The second user will have error and cant do build.

Error message System.UnauthorizedAccessException: Access to the path 'Global\Metalama.Configuration' is denied. at System.Threading.Mutex.OpenExistingWorker(String name, Mutex& result) at Metalama.Backstage.Utilities.MutexHelper.OpenOrCreateMutex(String mutexName, ILogger logger) at Metalama.Backstage.Configuration.ConfigurationManager..ctor(IServiceProvider serviceProvider) at Metalama.Backstage.Extensibility.RegisterServiceExtensions.<>c.b3_6(IServiceProvider serviceProvider) at Metalama.Backstage.Extensibility.RegisterServiceExtensions.<>c__DisplayClass1_0`1.b0(IServiceProvider serviceProvider) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitFactory(FactoryCallSite factoryCallSite, RuntimeResolverContext context) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite callSite, RuntimeResolverContext context) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor2.VisitCallSite(ServiceCallSite callSite, TArgument argument) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.Resolve(ServiceCallSite callSite, ServiceProviderEngineScope scope) at Microsoft.Extensions.DependencyInjection.ServiceProvider.CreateServiceAccessor(Type serviceType) at System.Collections.Concurrent.ConcurrentDictionary2.GetOrAdd(TKey key, Func2 valueFactory) at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(Type serviceType, ServiceProviderEngineScope serviceProviderEngineScope) at Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope.GetService(Type serviceType) at Metalama.Backstage.Extensibility.ServiceProviderExtensions.GetBackstageService[TService](IServiceProvider serviceProvider) at Metalama.Backstage.Extensibility.ServiceProviderExtensions.GetRequiredBackstageService[TService](IServiceProvider serviceProvider) at Metalama.Backstage.Licensing.Registration.LicenseRegistrationService..ctor(IServiceProvider serviceProvider) at Metalama.Backstage.Extensibility.RegisterServiceExtensions.<>c.b4_2(IServiceProvider serviceProvider) at Metalama.Backstage.Extensibility.RegisterServiceExtensions.<>c__DisplayClass1_0`1.b0(IServiceProvider serviceProvider) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitFactory(FactoryCallSite factoryCallSite, RuntimeResolverContext context) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite callSite, RuntimeResolverContext context) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor2.VisitCallSite(ServiceCallSite callSite, TArgument argument) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.Resolve(ServiceCallSite callSite, ServiceProviderEngineScope scope) at Microsoft.Extensions.DependencyInjection.ServiceProvider.CreateServiceAccessor(Type serviceType) at System.Collections.Concurrent.ConcurrentDictionary2.GetOrAdd(TKey key, Func2 valueFactory) at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(Type serviceType, ServiceProviderEngineScope serviceProviderEngineScope) at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(Type serviceType) at Metalama.Backstage.Extensibility.ServiceProviderExtensions.GetBackstageService[TService](IServiceProvider serviceProvider) at Metalama.Backstage.Extensibility.ServiceProviderExtensions.GetRequiredBackstageService[TService](IServiceProvider serviceProvider) at Metalama.Backstage.Commands.Licensing.ListLicensesCommand.Execute(ExtendedCommandContext context, BaseCommandSettings settings) at Metalama.Backstage.Commands.BaseCommand`1.Execute(CommandContext context, T settings) Error: One or more errors occurred. (Access to the path 'Global\Metalama.Configuration' is denied.) (Access to the path 'Global\Metalama.Configuration' is denied.)

svick commented 2 months ago

Thanks for the report. I'll work on fixing this.

prochan2 commented 1 month ago

This bug has been fixed in Metalama 2024.2.26 and will be fixed in Metalama 2025.0.