Open Closed

error Could not load file or assembly Volo.Payment.Domain.Shared when using the module from source code. #1872


User avatar
0
tkettani@cogan.com created

hello when creating a new project with the following settings and using the payment module from code i get the following error when lunching the db migrator :

System.IO.FileLoadException Could not load file or assembly 'Volo.Payment.Domain.Shared, Version=4.4.2.0, Culture=neutral, PublicKeyToken=null'. The located assembly's manifest definition does not match the assembly reference. (0x80131040)

the code compiles with no errors and i checked the .csproj of all sub projects and none reference the 4.4.2 package version of the payment module. all the relevant projects reference the source code one (which compiles fine and creates the right dlls).

thanks for helping with this issue.

  • ABP Framework version: v4.4.2
  • UI type: Blazor
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): no
  • Exception message and stack trace:
 System.IO.FileLoadException
  HResult=0x80131040
  Message=Could not load file or assembly 'Volo.Payment.Domain.Shared, Version=4.4.2.0, Culture=neutral, PublicKeyToken=null'. The located assembly's manifest definition does not match the assembly reference. (0x80131040)
  Source=System.Private.CoreLib
  StackTrace:
   at System.Reflection.CustomAttribute._CreateCaObject(RuntimeModule pModule, RuntimeType type, IRuntimeMethodInfo pCtor, Byte** ppBlob, Byte* pEndBlob, Int32* pcNamedArgs)
   at System.Reflection.CustomAttribute.CreateCaObject(RuntimeModule module, RuntimeType type, IRuntimeMethodInfo ctor, IntPtr& blob, IntPtr blobEnd, Int32& namedArgs)
   at System.Reflection.CustomAttribute.AddCustomAttributes(ListBuilder`1& attributes, RuntimeModule decoratedModule, Int32 decoratedMetadataToken, RuntimeType attributeFilterType, Boolean mustBeInheritable, ListBuilder`1 derivedAttributes)
   at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeType type, RuntimeType caType, Boolean inherit)
   at System.RuntimeType.GetCustomAttributes(Type attributeType, Boolean inherit)
   at System.Attribute.GetCustomAttributes(MemberInfo element, Boolean inherit)
   at Volo.Abp.Modularity.AbpModuleHelper.FindDependedModuleTypes(Type moduleType)
   at Volo.Abp.Modularity.AbpModuleHelper.AddModuleAndDependenciesRecursively(List`1 moduleTypes, Type moduleType, ILogger logger, Int32 depth)
   at Volo.Abp.Modularity.AbpModuleHelper.AddModuleAndDependenciesRecursively(List`1 moduleTypes, Type moduleType, ILogger logger, Int32 depth)
   at Volo.Abp.Modularity.AbpModuleHelper.AddModuleAndDependenciesRecursively(List`1 moduleTypes, Type moduleType, ILogger logger, Int32 depth)
   at Volo.Abp.Modularity.AbpModuleHelper.AddModuleAndDependenciesRecursively(List`1 moduleTypes, Type moduleType, ILogger logger, Int32 depth)
   at Volo.Abp.Modularity.AbpModuleHelper.AddModuleAndDependenciesRecursively(List`1 moduleTypes, Type moduleType, ILogger logger, Int32 depth)
   at Volo.Abp.Modularity.AbpModuleHelper.FindAllModuleTypes(Type startupModuleType, ILogger logger)
   at Volo.Abp.Modularity.ModuleLoader.FillModules(List`1 modules, IServiceCollection services, Type startupModuleType, PlugInSourceList plugInSources)
   at Volo.Abp.Modularity.ModuleLoader.GetDescriptors(IServiceCollection services, Type startupModuleType, PlugInSourceList plugInSources)
   at Volo.Abp.Modularity.ModuleLoader.LoadModules(IServiceCollection services, Type startupModuleType, PlugInSourceList plugInSources)
   at Volo.Abp.AbpApplicationBase.LoadModules(IServiceCollection services, AbpApplicationCreationOptions options)
   at Volo.Abp.AbpApplicationBase..ctor(Type startupModuleType, IServiceCollection services, Action`1 optionsAction)
   at Volo.Abp.AbpApplicationWithInternalServiceProvider..ctor(Type startupModuleType, IServiceCollection services, Action`1 optionsAction)
   at Volo.Abp.AbpApplicationWithInternalServiceProvider..ctor(Type startupModuleType, Action`1 optionsAction)
   at Volo.Abp.AbpApplicationFactory.Create(Type startupModuleType, Action`1 optionsAction)
   at Volo.Abp.AbpApplicationFactory.Create[TStartupModule](Action`1 optionsAction)
   at ITDA.DbMigrator.DbMigratorHostedService.<StartAsync>d__3.MoveNext() in C:\Projects\KTech\ITDA\aspnet-core\src\ITDA.DbMigrator\DbMigratorHostedService.cs:line 25
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.ConfiguredTaskAwaitable.ConfiguredTaskAwaiter.GetResult()
   at Microsoft.Extensions.Hosting.Internal.Host.<StartAsync>d__9.MoveNext()
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.ConfiguredTaskAwaitable.ConfiguredTaskAwaiter.GetResult()
   at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.<RunAsync>d__4.MoveNext()
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.<RunAsync>d__4.MoveNext()
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
   at ITDA.DbMigrator.Program.<Main>d__0.MoveNext() in C:\Projects\KTech\ITDA\aspnet-core\src\ITDA.DbMigrator\Program.cs:line 30
  • Steps to reproduce the issue:" create a new project with version 4.4.* and chose to use the payment module from source code. then try running the db migrator the first time to create the schema

3 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    create a new project with version 4.4.* and chose to use the payment module from source code.

    Can you share this project with me? liming.ma@volosoft.com

  • User Avatar
    1
    tkettani@cogan.com created

    hello after a weekend of troubleshooting i was able to figure out the problem and find a workaround. turns out the SaaS module uses the payment module now and if you include the source code of the payment module as a project, there is an orphan reference to the package version of the payment module in the saas module. solution i found was to include the saas module as source code as well and clean up the references and now all is well. i don't need to be using the source code of that particular module it adds a lot of unnecessary compilation so it may be a good idea to investigate and adjust it but for now this is acceptable and i can continue my development. thanks for reaching out and hopefully this helps someone else.

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

Made with ❤️ on ABP v8.2.0-preview Updated on March 25, 2024, 15:11