Orchardcore: My Blog Is Destroy,OH MY GOD!!

Created on 5 Sep 2018  ·  11Comments  ·  Source: OrchardCMS/OrchardCore

WebSite:
http://blog.jiqunar.com/admin
Error Message:
An error occured while executing this request.

What Should I Do??

question

Most helpful comment

I know why ... we fixed it in dev actually. The idea is that it's using the shared ASP.NET framework, and it has been updated on Azure. The code we are using doesn't contain a bug fix that was shipped and which makes it compatible with the 2.1.2 framework that is used on Azure by default.

The solution is to edit the web project csproj and update the this package version:
<PackageReference Include="Microsoft.AspNetCore.App" Version="2.1.3"/>

The other solution is to use a recent version of the dev branch which uses the fix from MVC (more recent than last week).

All 11 comments

Do you have access to the log file?

I run it in docker,how can i get the error log?

SSH into the container if it's linux and open the log file with vim editor or install a FTP on the container to download the file.

sudo docker exec -it --name lightblog bash

This will open a shell on the environment, then cd /app/App_Data/logs to access the logs

My test website on Azure recently started failing with the same error. I hadn't done any new deployments, so it must have been an Azure update, possibly to a newer ASP.NET Core version.

This was the log entry:

5dsh0ser.qd5(34,58): error CS0433: The type 'RazorInjectAttribute' exists in both 'Microsoft.AspNetCore.Mvc.Razor, Version=2.1.1.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' and 'Microsoft.AspNetCore.Mvc.Razor, Version=2.1.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'
   at Microsoft.AspNetCore.Mvc.Razor.Internal.SharedRazorViewCompiler.CompileAndEmit(RazorCodeDocument codeDocument, String generatedCode) in d:\c\2\5\s\src\OrchardCore\OrchardCore.Mvc.Core\SharedRazorViewCompiler.cs:line 385

I haven't fixed it yet, I tried updating my branch to the latest dependencies and rebuilding/deploying but no luck. Guess i need to figure out why there's two versions of Microsoft.AspNetCore.Mvc.Razor present.

I know why ... we fixed it in dev actually. The idea is that it's using the shared ASP.NET framework, and it has been updated on Azure. The code we are using doesn't contain a bug fix that was shipped and which makes it compatible with the 2.1.2 framework that is used on Azure by default.

The solution is to edit the web project csproj and update the this package version:
<PackageReference Include="Microsoft.AspNetCore.App" Version="2.1.3"/>

The other solution is to use a recent version of the dev branch which uses the fix from MVC (more recent than last week).

@sebastienros Thank you so much! That fixed it and saved me a number of hours of troubleshooting.

i get the error log:

2018-09-07 06:11:10.6772|Default|0HLGIF5JS1EUF:00000001||Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware|ERROR|An unhandled exception has occurred while executing the request. System.ObjectDisposedException: Cannot access a $
Object name: 'IServiceProvider'.
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.ThrowHelper.ThrowObjectDisposedException()
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope.GetService(Type serviceType)
   at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(IServiceProvider provider, Type serviceType)
   at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService[T](IServiceProvider provider)
   at Microsoft.AspNetCore.Mvc.ModelBinding.Binders.FloatingPointTypeModelBinderProvider.GetBinder(ModelBinderProviderContext context)
   at Microsoft.AspNetCore.Mvc.ModelBinding.ModelBinderFactory.CreateBinderCoreUncached(DefaultModelBinderProviderContext providerContext, Object token)
   at Microsoft.AspNetCore.Mvc.ModelBinding.ModelBinderFactory.CreateBinder(ModelBinderFactoryContext context)
   at Microsoft.AspNetCore.Mvc.Internal.ControllerBinderDelegateProvider.GetParameterBindingInfo(IModelBinderFactory modelBinderFactory, IModelMetadataProvider modelMetadataProvider, ControllerActionDescriptor actionDescriptor, MvcOptio$
   at Microsoft.AspNetCore.Mvc.Internal.ControllerBinderDelegateProvider.CreateBinderDelegate(ParameterBinder parameterBinder, IModelBinderFactory modelBinderFactory, IModelMetadataProvider modelMetadataProvider, ControllerActionDescrip$
   at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvokerCache.GetCachedResult(ControllerContext controllerContext)
   at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvokerProvider.OnProvidersExecuting(ActionInvokerProviderContext context)
   at Microsoft.AspNetCore.Mvc.Internal.ActionInvokerFactory.CreateInvoker(ActionContext actionContext)
   at Microsoft.AspNetCore.Mvc.Internal.MvcRouteHandler.<>c__DisplayClass8_0.<RouteAsync>b__0(HttpContext c)
   at Microsoft.AspNetCore.Builder.RouterMiddleware.Invoke(HttpContext httpContext)
   at Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware.Invoke(HttpContext context)
   at SixLabors.ImageSharp.Web.Middleware.ImageSharpMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Diagnostics.StatusCodePagesMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware.Invoke(HttpContext context)    at Microsoft.Extensions.DependencyInjection.ServiceLookup.ThrowHelper.ThrowObjectDisposedException()
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope.GetService(Type serviceType)
   at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(IServiceProvider provider, Type serviceType)
   at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService[T](IServiceProvider provider)
   at Microsoft.AspNetCore.Mvc.ModelBinding.Binders.FloatingPointTypeModelBinderProvider.GetBinder(ModelBinderProviderContext context)
   at Microsoft.AspNetCore.Mvc.ModelBinding.ModelBinderFactory.CreateBinderCoreUncached(DefaultModelBinderProviderContext providerContext, Object token)
   at Microsoft.AspNetCore.Mvc.ModelBinding.ModelBinderFactory.CreateBinder(ModelBinderFactoryContext context)
   at Microsoft.AspNetCore.Mvc.Internal.ControllerBinderDelegateProvider.GetParameterBindingInfo(IModelBinderFactory modelBinderFactory, IModelMetadataProvider modelMetadataProvider, ControllerActionDescriptor actionDescriptor, MvcOptio$
   at Microsoft.AspNetCore.Mvc.Internal.ControllerBinderDelegateProvider.CreateBinderDelegate(ParameterBinder parameterBinder, IModelBinderFactory modelBinderFactory, IModelMetadataProvider modelMetadataProvider, ControllerActionDescrip$
   at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvokerCache.GetCachedResult(ControllerContext controllerContext)
   at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvokerProvider.OnProvidersExecuting(ActionInvokerProviderContext context)
   at Microsoft.AspNetCore.Mvc.Internal.ActionInvokerFactory.CreateInvoker(ActionContext actionContext)
   at Microsoft.AspNetCore.Mvc.Internal.MvcRouteHandler.<>c__DisplayClass8_0.<RouteAsync>b__0(HttpContext c)
   at Microsoft.AspNetCore.Builder.RouterMiddleware.Invoke(HttpContext httpContext)
   at Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware.Invoke(HttpContext context)
   at SixLabors.ImageSharp.Web.Middleware.ImageSharpMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Diagnostics.StatusCodePagesMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware.Invoke(HttpContext context)

I have no idea, never seen this. What version where you using, if "master" aka beta2 then there might be issues that have been fixed already.

it annoy me, i use dev.maybe i should use master..

I tried the fix at https://github.com/OrchardCMS/OrchardCore/issues/2336#issuecomment-419271572 , but no change. This is on master. These are the changes I made:

diff --git a/src/OrchardCore.Cms.Web/OrchardCore.Cms.Web.csproj b/src/OrchardCore.Cms.Web/OrchardCore.Cms.Web.csproj
index 007d6576..a6b3274b
--- a/src/OrchardCore.Cms.Web/OrchardCore.Cms.Web.csproj
+++ b/src/OrchardCore.Cms.Web/OrchardCore.Cms.Web.csproj
@@ -18,7 +18,8 @@
   </ItemGroup>

   <ItemGroup>
-    <PackageReference Include="Microsoft.AspNetCore.App" />
+      <!-- <PackageReference Include="Microsoft.AspNetCore.App" /> -->
+    <PackageReference Include="Microsoft.AspNetCore.App" Version="2.1.3"/>
   </ItemGroup>

   <!-- Necessary as we reference the Project and not the Package -->
diff --git a/src/Templates/OrchardCore.Cms.Templates/content/OrchardCore.Templates.Cms.Web/OrchardCore.Templates.Cms.Web.csproj b/src/Templates/OrchardCore.Cms.Templates/content/OrchardCore.Templates.Cms.Web/OrchardCore.Templates.Cms.Web.csproj
index a9d537b2..d115a401
--- a/src/Templates/OrchardCore.Cms.Templates/content/OrchardCore.Templates.Cms.Web/OrchardCore.Templates.Cms.Web.csproj
+++ b/src/Templates/OrchardCore.Cms.Templates/content/OrchardCore.Templates.Cms.Web/OrchardCore.Templates.Cms.Web.csproj
@@ -16,7 +16,8 @@
   </ItemGroup>

   <ItemGroup>
-    <PackageReference Include="Microsoft.AspNetCore.App" />
+    <!-- PackageReference Include="Microsoft.AspNetCore.App" / -->
+    <PackageReference Include="Microsoft.AspNetCore.App" Version="2.1.3"/>
   </ItemGroup>

 </Project>

When I switch to dev, build fails to find the latest package versions (needs >= 1.0.0-beta-9461, finds 1.0.0-beta-9446), e.g. one example of many:

C:\Users\John\git\OrchardCore\src\OrchardCore\OrchardCore.Workflows.Abstractions\OrchardCore.Workflows.Abstractions.csproj : error NU1102: Unable to find package Fluid.Core with version (>= 1.0.0-beta-9461) [C:\Users\John\git\OrchardCore\src\OrchardCore.Cms.Web\OrchardCore.Cms.Web.csproj]
C:\Users\John\git\OrchardCore\src\OrchardCore\OrchardCore.Workflows.Abstractions\OrchardCore.Workflows.Abstractions.csproj : error NU1102: - Found 26 version(s) in nuget.org [ Nearest version: 1.0.0-beta-9446 ] [C:\Users\John\git\OrchardCore\src\OrchardCore.Cms.Web\OrchardCore.Cms.Web.csproj]

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jardg picture jardg  ·  3Comments

lzw5399 picture lzw5399  ·  3Comments

kevinchalet picture kevinchalet  ·  4Comments

sebastienros picture sebastienros  ·  4Comments

chillibug picture chillibug  ·  4Comments