question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Upgrade fails from 9.8.1 to 9.9.0 - Could not load file or assembly 'MailKit'

See original GitHub issue

Description of bug

Upgrade from 9.8.1 to 9.9.0 gives the error: Exception Details: System.IO.FileLoadException: Could not load file or assembly ‘MailKit’ or one of its dependencies. The located assembly’s manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

Steps to reproduce

List the precise steps to reproduce the bug:

  1. Download the Upgrade package and remove the Block in Properties
  2. Unzip to DNN directory
  3. Go to URL: http://localhost/dotnetnuke/install/install.aspx
  4. See error

Current behavior

Explain the current behavior. Cannot upgrade DNN due to error.

Expected behavior

Provide a clear and concise description of the expected behavior. Upgrade process should not produce an error.

Screenshots

If applicable, provide screenshots to help explain the bug.

image

Error information

Provide any error information (console errors, error logs, etc.) related to this bug.

[FileLoadException: Could not load file or assembly 'MailKit' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)] [FileLoadException: Could not load file or assembly 'MailKit, Version=2.7.0.0, Culture=neutral, PublicKeyToken=4e064fe7c44a8f1b' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)] System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +0 System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +37 System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +159 System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean forIntrospection) +80 System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +22 System.Reflection.Assembly.Load(String assemblyString) +29 System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +39 [ConfigurationErrorsException: Could not load file or assembly 'MailKit, Version=2.7.0.0, Culture=neutral, PublicKeyToken=4e064fe7c44a8f1b' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)] System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +777 System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory() +229 System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo ai) +140 System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig) +176 System.Web.Compilation.BuildManager.GetPreStartInitMethodsFromReferencedAssemblies() +99 System.Web.Compilation.BuildManager.CallPreStartInitMethods(String preStartInitListPath, Boolean& isRefAssemblyLoaded) +310 System.Web.Compilation.BuildManager.ExecutePreAppStart() +165 System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) +590 [HttpException (0x80004005): Could not load file or assembly 'MailKit, Version=2.7.0.0, Culture=neutral, PublicKeyToken=4e064fe7c44a8f1b' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)] System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +10087352 System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +99 System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +263 --

Additional context

Provide any additional context that may be helpful in understanding and/or resolving the bug. I looked in the Upgrade zip file for the MailKit manifest but could not easily locate it.

Upgrade file was DNN_Platform_9.9.0_Upgrade.zip

Affected version

  • 10.00.00 alpha build
  • [ X] 09.09.00 release
  • 09.08.01 latest supported release

Affected browser

  • Chrome
  • [X ] Firefox
  • Safari
  • Internet Explorer 11
  • Microsoft Edge (Classic)
  • Microsoft Edge Chromium

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:12 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
TopCat6commented, Mar 10, 2021

Yes, the updated version of their Common Library (v4.0.6) fixes both MailKit and MimeKit issues. However, I don’t see that version on the public download list yet. You could try contacting them directly for it, I suppose.

1reaction
TopCat6commented, Mar 1, 2021

Mandeeps support has prepared an updated version of their Common Library (v4.0.6) which fixes the issue and should be published soon.

Read more comments on GitHub >

github_iconTop Results From Across the Web

System.IO.FileNotFoundException: Could not load file or ...
I am getting this runtime error in the windows event viewer. System.IO.FileNotFoundException: Could not load file or assembly 'MimeKit, ...
Read more >
Windows Form C# Application throws Could not load File ...
When I copy the Release version (exe-file) to a similar PC (Win 10, DotNet 4.8) I get the following error: Could not load...
Read more >
Issues Instantiating Mimekit.MimeMessage in PowerShell " ...
MimeMessage I get an error Exception calling ".ctor" with "0" arguments": could not load file or assembly 'System.Memory'... My next steps were ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found