Skip to content
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

.net 6 under windows iis - app can't start #338

Open
DevOnBike opened this issue Nov 8, 2022 · 5 comments
Open

.net 6 under windows iis - app can't start #338

DevOnBike opened this issue Nov 8, 2022 · 5 comments

Comments

@DevOnBike
Copy link

App hosted on iis under windows server 2012 after publishing can't start after deploy.

Here is relevant configuration in csproj

all runtime; build; native; contentfiles; analyzers

in version 3.3.0 everything works

@SimonCropp
Copy link
Contributor

can u share a minimal repro

also what does "can't start" mean? is an exception thrown?

@DevOnBike
Copy link
Author

DevOnBike commented Nov 10, 2022

can u share a minimal repro

no i can't :(

also what does "can't start" mean? is an exception thrown?

exactly

@SimonCropp
Copy link
Contributor

so whats the exception and stack trace?

@DevOnBike
Copy link
Author

Application '/LM/W3SVC/2/ROOT' with physical root 'C:...\www' hit unexpected managed exception, exception code = '0xe0434352'. First 30KB characters of captured stdout and stderr logs:
Unhandled exception. Autofac.Core.DependencyResolutionException: An exception was thrown while activating ?:Microsoft.Extensions.Hosting.IHost -> Microsoft.Extensions.Hosting.Internal.ApplicationLifetime -> Microsoft.Extensions.Logging.Logger1[[Microsoft.Extensions.Hosting.Internal.ApplicationLifetime, Microsoft.Extensions.Hosting, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]] -> ?:Microsoft.Extensions.Logging.ILoggerFactory -> ?:Serilog.SerilogHostBuilderExtensions+RegisteredLogger. ---> System.Reflection.CustomAttributeFormatException: Binary format of the specified custom attribute was invalid. at System.Reflection.CustomAttributeEncodedArgument.ParseAttributeArguments(IntPtr pCa, Int32 cCa, CustomAttributeCtorParameter[]& CustomAttributeCtorParameters, CustomAttributeNamedParameter[]& CustomAttributeTypedArgument, RuntimeAssembly assembly) at System.Reflection.RuntimeCustomAttributeData..ctor(RuntimeModule scope, MetadataToken caCtorToken, ConstArray& blob) at System.Reflection.RuntimeCustomAttributeData.GetCustomAttributes(RuntimeModule module, Int32 tkTarget) at System.Reflection.RuntimeCustomAttributeData.GetCustomAttributesInternal(RuntimeMethodInfo target) at System.Reflection.RuntimeMethodInfo.GetCustomAttributesData() at System.Reflection.MemberInfo.get_CustomAttributes() at Serilog.Settings.Configuration.ConfigurationReader.<FindConfigurationExtensionMethods>g__HasExtensionAttribute|32_0(MethodInfo m) at Serilog.Settings.Configuration.ConfigurationReader.<>c.<FindConfigurationExtensionMethods>b__32_3(MethodInfo m) at System.Linq.Utilities.<>c__DisplayClass1_01.b__0(TSource x)
at System.Linq.Enumerable.WhereEnumerableIterator1.ToList() at System.Linq.Enumerable.ToList[TSource](IEnumerable1 source)
at Serilog.Settings.Configuration.ConfigurationReader.FindConfigurationExtensionMethods(IReadOnlyCollection1 configurationAssemblies, Type configType) at Serilog.Settings.Configuration.ConfigurationReader.FindEventEnricherConfigurationMethods(IReadOnlyCollection1 configurationAssemblies)
at Serilog.Settings.Configuration.ConfigurationReader.ApplyEnrichment(LoggerConfiguration loggerConfiguration)
at Serilog.Settings.Configuration.ConfigurationReader.Configure(LoggerConfiguration loggerConfiguration)
at Serilog.Configuration.LoggerSettingsConfiguration.Settings(ILoggerSettings settings)
at Serilog.ConfigurationLoggerConfigurationExtensions.Configuration(LoggerSettingsConfiguration settingConfiguration, IConfiguration configuration, String sectionName, DependencyContext dependencyContext)
at Serilog.ConfigurationLoggerConfigurationExtensions.Configuration(LoggerSettingsConfiguration settingConfiguration, IConfiguration configuration, DependencyContext dependencyContext)
at Program.<>c__DisplayClass0_0.<

$>b__1(HostBuilderContext _, LoggerConfiguration loggerConfiguration) in /App/Program.cs:line 57
at Serilog.SerilogHostBuilderExtensions.<>c__DisplayClass2_0.b__0(HostBuilderContext hostBuilderContext, IServiceProvider services, LoggerConfiguration loggerConfiguration)
at Serilog.SerilogHostBuilderExtensions.<>c__DisplayClass3_1.b__1(IServiceProvider services)
at Autofac.Extensions.DependencyInjection.AutofacRegistration.<>c__DisplayClass3_0.b__0(IComponentContext context, IEnumerable1 parameters) at Autofac.Core.Activators.Delegate.DelegateActivator.ActivateInstance(IComponentContext context, IEnumerable1 parameters)
at Autofac.Core.Activators.Delegate.DelegateActivator.b__2_0(ResolveRequestContext ctxt, Action1 next) at Autofac.Core.Resolving.Middleware.DelegateMiddleware.Execute(ResolveRequestContext context, Action1 next)
at Autofac.Core.Resolving.Pipeline.ResolvePipelineBuilder.<>c__DisplayClass14_0.b__1(ResolveRequestContext ctxt)
at Autofac.Core.Resolving.Middleware.DisposalTrackingMiddleware.Execute(ResolveRequestContext context, Action1 next) at Autofac.Core.Resolving.Pipeline.ResolvePipelineBuilder.<>c__DisplayClass14_0.<BuildPipeline>b__1(ResolveRequestContext ctxt) at Autofac.Core.Resolving.Middleware.ActivatorErrorHandlingMiddleware.Execute(ResolveRequestContext context, Action1 next)
--- End of inner exception stack trace ---
at Autofac.Core.Resolving.Middleware.ActivatorErrorHandlingMiddleware.Execute(ResolveRequestContext context, Action1 next) at Autofac.Core.Resolving.Pipeline.ResolvePipelineBuilder.<>c__DisplayClass14_0.<BuildPipeline>b__1(ResolveRequestContext ctxt) at Autofac.Core.Pipeline.ResolvePipeline.Invoke(ResolveRequestContext ctxt) at Autofac.Core.Resolving.Middleware.RegistrationPipelineInvokeMiddleware.Execute(ResolveRequestContext context, Action1 next)
at Autofac.Core.Resolving.Pipeline.ResolvePipelineBuilder.<>c__DisplayClass14_0.b__1(ResolveRequestContext ctxt)
at Autofac.Core.Resolving.Middleware.SharingMiddleware.<>c__DisplayClass5_0.b__0()
at Autofac.Core.Lifetime.LifetimeScope.CreateSharedInstance(Guid id, Func1 creator) at Autofac.Core.Lifetime.LifetimeScope.CreateSharedInstance(Guid primaryId, Nullable1 qualifyingId, Func1 creator) at Autofac.Core.Resolving.Middleware.SharingMiddleware.Execute(ResolveRequestContext context, Action1 next)
at Autofac.Core.Resolving.Pipeline.ResolvePipelineBuilder.<>c__DisplayClass14_0.b__1(ResolveRequestContext ctxt)
at Autofac.Core.Resolving.Pipeline.ResolvePipelineBuilder.<>c__DisplayClass14_0.b__1(ResolveRequestContext ctxt)
at Autofac.Core.Resolving.Middleware.CircularDependencyDetectorMiddleware.Execute(ResolveRequestContext context, Action1 next) at Autofac.Core.Resolving.Pipeline.ResolvePipelineBuilder.<>c__DisplayClass14_0.<BuildPipeline>b__1(ResolveRequestContext ctxt) at Autofac.Core.Pipeline.ResolvePipeline.Invoke(ResolveRequestContext ctxt) at Autofac.Core.Resolving.ResolveOperation.GetOrCreateInstance(ISharingLifetimeScope currentOperationScope, ResolveRequest request) at Autofac.Core.Resolving.ResolveOperation.ExecuteOperation(ResolveRequest request) at Autofac.Core.Resolving.ResolveOperation.Execute(ResolveRequest request) at Autofac.Core.Lifetime.LifetimeScope.ResolveComponent(ResolveRequest request) at Autofac.Core.Container.ResolveComponent(ResolveRequest request) at Autofac.ResolutionExtensions.TryResolveService(IComponentContext context, Service service, IEnumerable1 parameters, Object& instance)
at Autofac.ResolutionExtensions.ResolveService(IComponentContext context, Service service, IEnumerable1 parameters) at Autofac.ResolutionExtensions.Resolve(IComponentContext context, Type serviceType, IEnumerable1 parameters)
at Autofac.ResolutionExtensions.Resolve(IComponentContext context, Type serviceType)
at Autofac.Extensions.DependencyInjection.AutofacServiceProvider.GetRequiredService(Type serviceType)
at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(IServiceProvider provider, Type serviceType)
at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService[T](IServiceProvider provider)
at Microsoft.Extensions.Hosting.HostBuilder.Build()
at Microsoft.AspNetCore.Builder.WebApplicationBuilder.Build()
at Program.<$>g__CreateApp|0_0(String[] args) in /App/Program.cs:line 59
at Program.$(String[] args) in /App/Program.cs:line 35
at Program.(String[] args)

@skomis-mm
Copy link
Contributor

Hi @DevOnBike ,

try the latest dev version, seems duplicate of #330

HTH!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants