#1
I have been following the instruction here, to integrate YAF into my existing MVC application:

https://github.com/YAFNE...ting-ASP.NET-Application 

My application already uses ServiceStack, and I notice that the binaries for YAF include a version of ServiceStack. Additionally, my application is .net 4.5.2 and I think YAF is 4.0. I initially did not replace my existing ServiceStack dlls when I copied the bin folder from the YAF application into my existing bin folder, but I received an error message:

Quote:

Server Error in '/' Application.
Could not load file or assembly 'ServiceStack.Interfaces, Version=3.9.14.0, Culture=neutral, PublicKeyToken=8b49dc47f4701f66' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
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.IO.FileLoadException: Could not load file or assembly 'ServiceStack.Interfaces, Version=3.9.14.0, Culture=neutral, PublicKeyToken=8b49dc47f4701f66' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

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.

Assembly Load Trace: The following information can be helpful to determine why the assembly 'ServiceStack.Interfaces, Version=3.9.14.0, Culture=neutral, PublicKeyToken=8b49dc47f4701f66' could not be loaded.


=== Pre-bind state information ===
LOG: DisplayName = ServiceStack.Interfaces, Version=3.9.14.0, Culture=neutral, PublicKeyToken=8b49dc47f4701f66
(Fully-specified)
LOG: Appbase = file:///C:/Users/forant/Documents/Visual Studio 2015/Projects/GAA/GAA/
LOG: Initial PrivatePath = C😕Users\forant\Documents\Visual Studio 2015\Projects\GAA\GAA\bin
Calling assembly : YAF.Types, Version=2.0.0.0, Culture=neutral, PublicKeyToken=f3828393ba2d803c.
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C😕Users\forant\Documents\Visual Studio 2015\Projects\GAA\GAA\web.config
LOG: Using host configuration file: C😕Users\forant\Documents\IISExpress\config\aspnet.config
LOG: Using machine configuration file from C😕Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Post-policy reference: ServiceStack.Interfaces, Version=3.9.14.0, Culture=neutral, PublicKeyToken=8b49dc47f4701f66
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files/root/9e5d23df/3d222704/ServiceStack.Interfaces.DLL.
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files/root/9e5d23df/3d222704/ServiceStack.Interfaces/ServiceStack.Interfaces.DLL.
LOG: Attempting download of new URL file:///C:/Users/forant/Documents/Visual Studio 2015/Projects/GAA/GAA/bin/ServiceStack.Interfaces.DLL.
WRN: Comparing the assembly name resulted in the mismatch: Major Version
ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated.


Stack Trace:


[FileLoadException: Could not load file or assembly 'ServiceStack.Interfaces, Version=3.9.14.0, Culture=neutral, PublicKeyToken=8b49dc47f4701f66' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)]
System.ModuleHandle.ResolveType(RuntimeModule module, Int32 typeToken, IntPtr* typeInstArgs, Int32 typeInstCount, IntPtr* methodInstArgs, Int32 methodInstCount, ObjectHandleOnStack type) +0
System.ModuleHandle.ResolveTypeHandleInternal(RuntimeModule module, Int32 typeToken, RuntimeTypeHandle[] typeInstantiationContext, RuntimeTypeHandle[] methodInstantiationContext) +145
System.Reflection.RuntimeModule.ResolveType(Int32 metadataToken, Type[] genericTypeArguments, Type[] genericMethodArguments) +130
System.Reflection.CustomAttribute.FilterCustomAttributeRecord(CustomAttributeRecord caRecord, MetadataImport scope, Assembly& lastAptcaOkAssembly, RuntimeModule decoratedModule, MetadataToken decoratedToken, RuntimeType attributeFilterType, Boolean mustBeInheritable, Object[] attributes, IList derivedAttributes, RuntimeType& attributeType, IRuntimeMethodInfo& ctor, Boolean& ctorHasParameters, Boolean& isVarArg) +91
System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeModule decoratedModule, Int32 decoratedMetadataToken, Int32 pcaCount, RuntimeType attributeFilterType, Boolean mustBeInheritable, IList derivedAttributes, Boolean isDecoratedTargetSecurityTransparent) +418
System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeType type, RuntimeType caType, Boolean inherit) +241
System.RuntimeType.GetCustomAttributes(Type attributeType, Boolean inherit) +58
YAF.Core.<>c__DisplayClass4`1.<FindClassesWithAttribute>b__3(Type t) +40
System.Linq.WhereArrayIterator`1.MoveNext() +51
System.Collections.Generic.List`1..ctor(IEnumerable`1 collection) +387
System.Linq.Enumerable.ToList(IEnumerable`1 source) +58
YAF.Core.<>c__DisplayClass4`1.<FindClassesWithAttribute>b__2(Assembly a) +86
System.Linq.WhereSelectArrayIterator`2.MoveNext() +58
YAF.Core.AssemblyExtensions.FindClassesWithAttribute(IEnumerable`1 assemblies) +237
YAF.Core.Modules.DynamicServicesModule.RegisterDynamicServices(Assembly[] assemblies) +132
YAF.Core.Modules.DynamicServicesModule.Load(ContainerBuilder containerBuilder) +20
YAF.Core.BaseModule.Configure(IComponentRegistry componentRegistry) +90
Autofac.ContainerBuilder.Build(IComponentRegistry componentRegistry, Boolean excludeDefaultModules) +113
Autofac.ContainerBuilder.Update(IComponentRegistry componentRegistry) +14
YAF.Core.IHaveComponentRegistryExtensions.UpdateRegistry(IHaveComponentRegistry haveComponentRegistry, ContainerBuilder containerBuilder) +64
YAF.Core.BaseModule.RegisterBaseModules(Assembly[] assemblies, IEnumerable`1 exclude) +503
YAF.Core.Modules.BootstrapModule.Load(ContainerBuilder builder) +100
YAF.Core.BaseModule.Configure(IComponentRegistry componentRegistry) +90
Autofac.ContainerBuilder.Build(IComponentRegistry componentRegistry, Boolean excludeDefaultModules) +113
Autofac.ContainerBuilder.Build(ContainerBuildOptions options) +53
YAF.Core.GlobalContainer.CreateContainer() +81
YAF.Core.GlobalContainer..cctor() +14

[TypeInitializationException: The type initializer for 'YAF.Core.GlobalContainer' threw an exception.]
YAF.Core.YafTaskModule.Init(HttpApplication httpApplication) +137
System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +536
System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +173
System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +336
System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +296

[HttpException (0x80004005): The type initializer for 'YAF.Core.GlobalContainer' threw an exception.]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +10043752
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +95
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +254



Figuring the version of ServiceStack I have is perhaps not compatible with the yaf app, I over-wrote the files in bin with the sample application Service Stack files. But I still get the same error message. Any suggestions as to how I resolve this? I'm really hoping the answer isn't binning all my existing nuget packages, downgrading my application to 4.0 and then reinstalling them all!...

Thanks in advance

Tony
Topic Starter
  • Antelopetube
  • Rank: YAF Forumling
  • Reputation:
    Neutral
    50.6%
  • Joined: 11/10/2018
  • Posts: 1
  •  United Kingdom
#2
I'm not sure this is able to be done. I thought someone did though? I can't remember.

http://yetanotherforum.n...ting-asp-net-mvc-website 

http://yetanotherforum.n...shipProvider-Integration 
  • Zero2Cool
  • Rank: YAF Leader
  • Reputation:
    Exalted
    100%
  • Medals:
    Medal of Honor for the Support Knight: Given to a community member who has assisted lots and lots of people!
  • Joined: 26/04/2011
  • Posts: 1,073
  •  Man  United States
  • Location: in a van down by the river
  • Thanks: 243 times
  • Was thanked: 102 time(s) in 93 post(s)
#3
Originally Posted by: Antelopetube

Figuring the version of ServiceStack I have is perhaps not compatible with the yaf app, I over-wrote the files in bin with the sample application Service Stack files. But I still get the same error message. Any suggestions as to how I resolve this? I'm really hoping the answer isn't binning all my existing nuget packages, downgrading my application to 4.0 and then reinstalling them all!...

Thanks in advance

Tony



Sorry for the late answer. The latest YAF.NET uses .NET 4.5.2 so you have not to downgrade your app. YAF.NET uses Service Stack 5.1.0 in order to integrate YAF in to your app you would need to update your nuget references to ServiceStack 5.1.0


UserPostedImage
  • tha_watcha
  • Rank: YAF.NET Project Lead
  • Reputation:
    Exalted
    100%
  • Medals:
    Medal of Honor: Portal Puzzle Master: Portal Puzzle Master for DNNMedal of Honor Key: Given to pillars of the community who are key players in the YAF community and project.DNN Master: DNN Module ManBug Killer Medal of Honor: Medal for being a kick-ass bug killer!Medal of Honor for the Support King: Support King! Amazing asset to the YAF.NET Community.
  • Joined: 06/03/2010
  • Posts: 4,002
  •  Germany
  • Thanks: 74 times
  • Was thanked: 1205 time(s) in 1031 post(s)
Forum Jump  
  • You cannot post new topics in this forum.
  • You cannot reply to topics in this forum.
  • You cannot delete your posts in this forum.
  • You cannot edit your posts in this forum.
  • You cannot create polls in this forum.
  • You cannot vote in polls in this forum.

About Us

The YAF.NET is an open source .NET forum project. YAF.NET is supported by an team of international developers who are build community by building community software.

Powered by Resharper Donate with PayPal button

Project Twitter Updates

Copyright © YetAnotherForum.NET & Ingo Herbote. All rights reserved