我已经从github.com/VirtoCommerce/vc-storefront-core部署到我的Azure帐户,但在浏览到店面网站时出现以下错误:
启动应用程序时出错。
.NET Core 4.6.26212.01 X86 v4.0.0.0 | Microsoft.AspNetCore.Hosting版本2.0.0-rtm-26452 | Microsoft Windows 10.0.14393 |需要帮忙?
我已确认内容连接字符串正确,App ID和密钥。
查看Azure中的日志流,它是一个500.0错误,它为可能的错误/解决方案提供的链接是to a Microsoft support atticle 它不提供任何Azure信息。
我已经通过Kudu控制台启用了日志记录,而抛出的异常是
`Application startup exception: System.NullReferenceException: Object reference not set to an instance of an object.
at VirtoCommerce.Storefront.Extensions.HostingEnviromentExtension.MapPath(IHostingEnvironment hostEnv, String path) in D:\home\site\repository\VirtoCommerce.Storefront\Extensions\HostingEnviromentExtension.cs:line 12
at VirtoCommerce.Storefront.Startup.<>c__DisplayClass7_0.<ConfigureServices>b__5(FileSystemBlobContentOptions options) in D:\home\site\repository\VirtoCommerce.Storefront\Startup.cs:line 134
at Microsoft.Extensions.Options.ConfigureNamedOptions``1.Configure(String name, TOptions options)
at Microsoft.Extensions.Options.OptionsFactory``1.Create(String name)
at Microsoft.Extensions.Options.OptionsManager``1.<>c__DisplayClass5_0.<Get>b__0()
at System.Lazy``1.ViaFactory(LazyThreadSafetyMode mode)
at System.Lazy``1.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor)
at System.Lazy``1.CreateValue()
at System.Lazy``1.get_Value()
at Microsoft.Extensions.Options.OptionsCache``1.GetOrAdd(String name, Func``1 createOptions)
at Microsoft.Extensions.Options.OptionsManager``1.Get(String name)
at Microsoft.Extensions.Options.OptionsManager``1.get_Value()
at VirtoCommerce.Storefront.Domain.FileSystemContentBlobProvider..ctor(IOptions``1 options, IMemoryCache memoryCache) in D:\home\site\repository\VirtoCommerce.Storefront\Domain\ContentBlobProviders\FileSystemContentBlobProvider.cs:line 25
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, ServiceProvider provider)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor``2.VisitCallSite(IServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScoped(ScopedCallSite scopedCallSite, ServiceProvider provider)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitSingleton(SingletonCallSite singletonCallSite, ServiceProvider provider)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor``2.VisitCallSite(IServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, ServiceProvider provider)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor``2.VisitCallSite(IServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScoped(ScopedCallSite scopedCallSite, ServiceProvider provider)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitSingleton(SingletonCallSite singletonCallSite, ServiceProvider provider)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor``2.VisitCallSite(IServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceProvider.<>c__DisplayClass22_0.<RealizeService>b__0(ServiceProvider provider)
at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(Type serviceType)
at Microsoft.Extensions.Internal.ActivatorUtilities.ConstructorMatcher.CreateInstance(IServiceProvider provider)
at Microsoft.Extensions.Internal.ActivatorUtilities.CreateInstance(IServiceProvider provider, Type instanceType, Object[] parameters)
at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.<>c__DisplayClass4_0.<UseMiddleware>b__0(RequestDelegate next)
at Microsoft.AspNetCore.Builder.Internal.ApplicationBuilder.Build()
at Microsoft.AspNetCore.Hosting.Internal.WebHost.BuildApplication()
crit: Microsoft.AspNetCore.Hosting.Internal.WebHost[6]'
答案 0 :(得分:0)
尝试对Web App使用远程调试,您可以在其中获取异常以获取有关调试的更多信息。请参阅以下文章:https://docs.microsoft.com/en-us/visualstudio/debugger/remote-debugging-azure以设置远程调试。 然后,您可以查看Azure应用服务上的“远程调试ASP.NET核心”部分&#34;看看你是否会找到任何有用的信息。