Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Nilay 8 posts 100 karma points
    Aug 02, 2022 @ 11:56
    Nilay
    0

    Value cannot be null. (Parameter 'source')

    I have setup Umbraco 10 website on hosting and getting below error. It works fine on local

    ArgumentNullException: Value cannot be null. (Parameter 'source')
    System.Linq.ThrowHelper.ThrowArgumentNullException(ExceptionArgument argument)
    
    ArgumentNullException: Value cannot be null. (Parameter 'source')
    System.Linq.ThrowHelper.ThrowArgumentNullException(ExceptionArgument argument)
    System.Linq.Enumerable.OfType<TResult>(IEnumerable source)
    Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionDescriptorProvider..ctor(IEnumerable<IPageRouteModelProvider> pageRouteModelProviders, IOptions<MvcOptions> mvcOptionsAccessor, IOptions<RazorPagesOptions> pagesOptionsAccessor)
    System.RuntimeMethodHandle.InvokeMethod(object target, ref Span<object> arguments, Signature sig, bool constructor, bool wrapExceptions)
    System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, object[] parameters, CultureInfo culture)
    Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, RuntimeResolverContext context)
    Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor<TArgument, TResult>.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
    Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite callSite, RuntimeResolverContext context)
    Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor<TArgument, TResult>.VisitCallSite(ServiceCallSite callSite, TArgument argument)
    Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitIEnumerable(IEnumerableCallSite enumerableCallSite, RuntimeResolverContext context)
    Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor<TArgument, TResult>.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
    Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor<TArgument, TResult>.VisitCallSite(ServiceCallSite callSite, TArgument argument)
    Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, RuntimeResolverContext context)
    Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor<TArgument, TResult>.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
    Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite callSite, RuntimeResolverContext context)
    Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor<TArgument, TResult>.VisitCallSite(ServiceCallSite callSite, TArgument argument)
    Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, RuntimeResolverContext context)
    Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor<TArgument, TResult>.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
    Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite callSite, RuntimeResolverContext context)
    Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor<TArgument, TResult>.VisitCallSite(ServiceCallSite callSite, TArgument argument)
    Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.Resolve(ServiceCallSite callSite, ServiceProviderEngineScope scope)
    Microsoft.Extensions.DependencyInjection.ServiceProvider.CreateServiceAccessor(Type serviceType)
    System.Collections.Concurrent.ConcurrentDictionary<TKey, TValue>.GetOrAdd(TKey key, Func<TKey, TValue> valueFactory)
    Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(Type serviceType, ServiceProviderEngineScope serviceProviderEngineScope)
    Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope.GetService(Type serviceType)
    Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(IServiceProvider provider, Type serviceType)
    Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService<T>(IServiceProvider provider)
    Microsoft.AspNetCore.Builder.ControllerEndpointRouteBuilderExtensions.GetOrCreateDataSource(IEndpointRouteBuilder endpoints)
    Microsoft.AspNetCore.Builder.ControllerEndpointRouteBuilderExtensions.MapControllerRoute(IEndpointRouteBuilder endpoints, string name, string pattern, object defaults, object constraints, object dataTokens)
    Microsoft.AspNetCore.Builder.ControllerEndpointRouteBuilderExtensions.MapAreaControllerRoute(IEndpointRouteBuilder endpoints, string name, string areaName, string pattern, object defaults, object constraints, object dataTokens)
    Umbraco.Extensions.EndpointRouteBuilderExtensions.MapUmbracoRoute(IEndpointRouteBuilder endpoints, Type controllerType, string rootSegment, string areaName, string prefixPathSegment, string defaultAction, bool includeControllerNameInRoute, object constraints)
    Umbraco.Cms.Web.BackOffice.Install.InstallAreaRoutes.CreateRoutes(IEndpointRouteBuilder endpoints)
    Umbraco.Extensions.UmbracoApplicationBuilderExtensions.UseInstallerEndpoints(IUmbracoEndpointBuilderContext app)
    Premneo.Website.Startup+<>c.<Configure>b__4_2(IUmbracoEndpointBuilderContext u) in Startup.cs
    Umbraco.Cms.Web.Common.ApplicationBuilder.UmbracoApplicationBuilder+<>c__DisplayClass17_0.<WithEndpoints>b__0(IEndpointRouteBuilder endpoints)
    Microsoft.AspNetCore.Builder.EndpointRoutingApplicationBuilderExtensions.UseEndpoints(IApplicationBuilder builder, Action<IEndpointRouteBuilder> configure)
    Umbraco.Cms.Web.Common.ApplicationBuilder.UmbracoApplicationBuilder.WithEndpoints(Action<IUmbracoEndpointBuilderContext> configureUmbraco)
    Premneo.Website.Startup.Configure(IApplicationBuilder app, IWebHostEnvironment env) in Startup.cs
    System.RuntimeMethodHandle.InvokeMethod(object target, ref Span<object> arguments, Signature sig, bool constructor, bool wrapExceptions)
    System.Reflection.RuntimeMethodInfo.Invoke(object obj, BindingFlags invokeAttr, Binder binder, object[] parameters, CultureInfo culture)
    Microsoft.AspNetCore.Hosting.ConfigureBuilder.Invoke(object instance, IApplicationBuilder builder)
    Microsoft.AspNetCore.Hosting.ConfigureBuilder+<>c__DisplayClass4_0.<Build>b__0(IApplicationBuilder builder)
    Microsoft.AspNetCore.Hosting.GenericWebHostBuilder+<>c__DisplayClass15_0.<UseStartup>b__1(IApplicationBuilder app)
    Microsoft.AspNetCore.Mvc.Filters.MiddlewareFilterBuilderStartupFilter+<>c__DisplayClass0_0.<Configure>g__MiddlewareFilterBuilder|0(IApplicationBuilder builder)
    Microsoft.AspNetCore.Server.IIS.Core.IISServerSetupFilter+<>c__DisplayClass2_0.<Configure>b__0(IApplicationBuilder app)
    Microsoft.AspNetCore.HostFilteringStartupFilter+<>c__DisplayClass0_0.<Configure>b__0(IApplicationBuilder app)
    Microsoft.AspNetCore.Hosting.GenericWebHostService.StartAsync(CancellationToken cancellationToken)
    Microsoft.Extensions.Hosting.Internal.Host.StartAsync(CancellationToken cancellationToken)
    Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)
    Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)
    Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.Run(IHost host)
    Premneo.Website.Program.Main(string[] args) in Program.cs
    
  • Andrew 52 posts 234 karma points
    Aug 02, 2022 @ 18:45
    Andrew
    0

    I'm getting the same error with site deployed to Elastic Beanstalk. (Works fine localy)

  • Isabelle Santin 2 posts 72 karma points
    Aug 02, 2022 @ 22:29
    Isabelle Santin
    0

    Same here, not sure what's going on...

  • Sebastiaan Janssen 5053 posts 15507 karma points MVP admin hq
    Aug 03, 2022 @ 07:00
    Sebastiaan Janssen
    102

    This usually indicates that the server you're deploying to is running an outdated version of .NET 6, we require .NET 6.0.5 to be running at least - you can ask your hosting provider to do an upgrade to the latest patch.

    To make matters more confusing, .NET 6.0.5 is included in .NET SDK 6.0.300. We highly recommend SDK 6.0.301 however (including .NET 6.0.6) because it contains a security patch.

  • Nilay 8 posts 100 karma points
    Aug 03, 2022 @ 09:54
    Nilay
    0

    Let me check with hosting

    Thanks

  • Andrew 52 posts 234 karma points
    Aug 03, 2022 @ 13:14
    Andrew
    0

    Hi Sebastiaan,

    I was pretty sure that was the cause of the problem but I'm not sure how to resolve it in Elastic Beanstalk.

    From what I see, 6.0.6 is supported, but I haven't figured out how to ensure/force it to use 6.0.6

    https://docs.aws.amazon.com/elasticbeanstalk/latest/platforms/platform-history-dotnetlinux.html

    Update: inside the EB "machine", dotnet --info says only 6.0.1 is available

  • Isabelle Santin 2 posts 72 karma points
    Aug 03, 2022 @ 14:59
    Isabelle Santin
    0

    Checking this out and seeing if a standalone deployment can do the trick. Thanks for the insight!

  • Nilay 8 posts 100 karma points
    Aug 04, 2022 @ 08:31
    Nilay
    2

    After upgrading .net core version it works

    Thanks Sebastiaan

  • fatmazayed 41 posts 122 karma points
    Oct 24, 2022 @ 19:25
    fatmazayed
    0

    upgrade vs or download latest version for .net 6 will fix the problem

  • Henk van den Bosch 4 posts 83 karma points
    Jun 02, 2023 @ 07:14
    Henk van den Bosch
    0

    I get the same error but i am running on a newer .net version

    enter image description here

Please Sign in or register to post replies

Write your reply to:

Draft