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

Install on clean DNN 9.8.0 errors #2

Open
roman-yagodin opened this issue Dec 18, 2020 · 5 comments
Open

Install on clean DNN 9.8.0 errors #2

roman-yagodin opened this issue Dec 18, 2020 · 5 comments
Labels
bug Something isn't working

Comments

@roman-yagodin
Copy link
Member

Method not found: 'Microsoft.Extensions.DependencyInjection.ServiceProvider Microsoft.Extensions.DependencyInjection.ServiceCollectionContainerBuilderExtensions.BuildServiceProvider(Microsoft.Extensions.DependencyInjection.IServiceCollection)'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.MissingMethodException: Method not found: 'Microsoft.Extensions.DependencyInjection.ServiceProvider Microsoft.Extensions.DependencyInjection.ServiceCollectionContainerBuilderExtensions.BuildServiceProvider(Microsoft.Extensions.DependencyInjection.IServiceCollection)'.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:


[MissingMethodException: Method not found: 'Microsoft.Extensions.DependencyInjection.ServiceProvider Microsoft.Extensions.DependencyInjection.ServiceCollectionContainerBuilderExtensions.BuildServiceProvider(Microsoft.Extensions.DependencyInjection.IServiceCollection)'.]
   DotNetNuke.Web.DependencyInjectionInitialize.BuildServiceProvider() +0
   DotNetNuke.Web.Common.Internal.DotNetNukeHttpApplication.Application_Start(Object sender, EventArgs eventArgs) +279

[HttpException (0x80004005): Method not found: 'Microsoft.Extensions.DependencyInjection.ServiceProvider Microsoft.Extensions.DependencyInjection.ServiceCollectionContainerBuilderExtensions.BuildServiceProvider(Microsoft.Extensions.DependencyInjection.IServiceCollection)'.]
   System.Web.HttpApplicationFactory.EnsureAppStartCalledForIntegratedMode(HttpContext context, HttpApplication app) +520
   System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +176
   System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +165
   System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +267
   System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +341

[HttpException (0x80004005): Method not found: 'Microsoft.Extensions.DependencyInjection.ServiceProvider Microsoft.Extensions.DependencyInjection.ServiceCollectionContainerBuilderExtensions.BuildServiceProvider(Microsoft.Extensions.DependencyInjection.IServiceCollection)'.]
   System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +523
   System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +107
   System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +688
@roman-yagodin roman-yagodin added the bug Something isn't working label Dec 18, 2020
@roman-yagodin
Copy link
Member Author

DNN 9.8.0 is shipped with Microsoft.Extensions.DependencyInjection assemblies of 2.1.1.0, while R7.Dnn.Extensions.EFCore - with 1.1.0.0 ones.

@roman-yagodin
Copy link
Member Author

Removing Microsoft.Extensions.DependencyInjection.dll and Microsoft.Extensions.DependencyInjection.Abstractions.dll from installer fixes crash after install, but could cause further issues.

@roman-yagodin roman-yagodin changed the title Install on clean DNN 9.8.0 error Install on clean DNN 9.8.0 errors Dec 18, 2020
@roman-yagodin
Copy link
Member Author

roman-yagodin commented Dec 18, 2020

Installing R7.University 2.7.1 after that produces following error. Probably will require binding redirect:

Message:Could not load file or assembly 'Microsoft.Extensions.DependencyInjection.Abstractions, Version=1.1.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

StackTrace:

InnerMessage:Could not load file or assembly 'Microsoft.Extensions.DependencyInjection.Abstractions, Version=1.1.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

InnerStackTrace:

   at Microsoft.EntityFrameworkCore.DbContext..ctor(DbContextOptions options)
   at R7.Dnn.Extensions.EFCore.EFCoreDataContextBase..ctor()
   at R7.Dnn.Extensions.EFCore.EFCoreDnnDataContextBase..ctor()
   at R7.University.Data.UniversityDataContextFactory.Create()
   at R7.Dnn.Extensions.Models.ModelContextBase.get_Context()
   at R7.Dnn.Extensions.Models.ModelContextBase.Query[TEntity]()
   at R7.University.Queries.FlatQuery`1.List()
   at R7.University.Launchpad.DocumentTypesTable.GetDataTable(PortalModuleBase module, UniversityModelContext modelContext, String search)
   at R7.University.Launchpad.LaunchpadTableBase.DataBind(PortalModuleBase module, UniversityModelContext modelContext, String search)
   at R7.University.Launchpad.ViewLaunchpad.BindTab(String tabName)
   at R7.University.Launchpad.ViewLaunchpad.OnLoadComplete(Object sender, EventArgs e)

@roman-yagodin
Copy link
Member Author

After adding binding redirect:

      <dependentAssembly xmlns="urn:schemas-microsoft-com:asm.v1">
        <assemblyIdentity name="Microsoft.Extensions.DependencyInjection" publicKeyToken="adb9793829ddae60" />
        <bindingRedirect oldVersion="0.0.0.0-1.1.0.0" newVersion="2.1.1.0" />
      </dependentAssembly>
      <dependentAssembly xmlns="urn:schemas-microsoft-com:asm.v1">
        <assemblyIdentity name="Microsoft.Extensions.DependencyInjection.Abstractions" publicKeyToken="adb9793829ddae60" />
        <bindingRedirect oldVersion="0.0.0.0-1.1.0.0" newVersion="2.1.1.0" />
      </dependentAssembly>

Launchpad produces following error:

Message:Method not found: 'System.IServiceProvider Microsoft.Extensions.DependencyInjection.ServiceCollectionContainerBuilderExtensions.BuildServiceProvider(Microsoft.Extensions.DependencyInjection.IServiceCollection)'.

StackTrace:

InnerMessage:Method not found: 'System.IServiceProvider Microsoft.Extensions.DependencyInjection.ServiceCollectionContainerBuilderExtensions.BuildServiceProvider(Microsoft.Extensions.DependencyInjection.IServiceCollection)'.

InnerStackTrace:

   at Microsoft.EntityFrameworkCore.Internal.ServiceProviderCache.<>c__DisplayClass4_1.<GetOrAdd>b__2(Int64 k)
   at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory)
   at Microsoft.EntityFrameworkCore.DbContext.GetServiceProvider(DbContextOptions options)
   at Microsoft.EntityFrameworkCore.DbContext..ctor(DbContextOptions options)
   at R7.Dnn.Extensions.EFCore.EFCoreDataContextBase..ctor()
   at R7.Dnn.Extensions.EFCore.EFCoreDnnDataContextBase..ctor()
   at R7.University.Data.UniversityDataContextFactory.Create()
   at R7.Dnn.Extensions.Models.ModelContextBase.get_Context()
   at R7.Dnn.Extensions.Models.ModelContextBase.Query[TEntity]()
   at R7.University.Queries.FlatQuery`1.List()
   at R7.University.Launchpad.DocumentTypesTable.GetDataTable(PortalModuleBase module, UniversityModelContext modelContext, String search)
   at R7.University.Launchpad.LaunchpadTableBase.DataBind(PortalModuleBase module, UniversityModelContext modelContext, String search)
   at R7.University.Launchpad.ViewLaunchpad.BindTab(String tabName)
   at R7.University.Launchpad.ViewLaunchpad.OnLoadComplete(Object sender, EventArgs e)

@roman-yagodin
Copy link
Member Author

roman-yagodin commented Dec 22, 2020

Installing 2sxc (e.g. 11.04.00) prior to R7.Dnn.Extensions.EFCore fixes the issue with R7.University due to proper binding redirects and moving required assemblies into bin/2sxc dir. This (plus removing DependencyInjection assemblies) could be considered a quickfix.

Proper solution is to adopt assembly binding code from 2sxc manifest:
2sic_2SexyContent.dnn.txt

In the future releases, this approach could allow to loosen implicit 2sxc relationship.

roman-yagodin added a commit that referenced this issue Dec 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant