Welcome Guest! To enable all features please Login or Register.
Options
View
Go to last post Go to first unread
Offline Antelopetube  
#1 Posted : 11 October 2018 12:30:07(UTC)
Antelopetube


Rank: YAF Forumling

Reputation:

Joined: 11/10/2018(UTC)
Posts: 1
United Kingdom

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

https://github.com/YAFNET/YAFNET/wiki/YAF.NET-Integration-in-to-an-existing-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
Sponsor
Offline Zero2Cool  
#2 Posted : 12 October 2018 15:55:14(UTC)
Zero2Cool


Rank: YAF Leader

Reputation:

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(UTC)
Posts: 1,069
Man
United States
Location: in a van down by the river

Thanks: 235 times
Was thanked: 101 time(s) in 92 post(s)
I'm not sure this is able to be done. I thought someone did though? I can't remember.

http://yetanotherforum.net/forum/posts/t17810-YAF-integration-to-existing-asp-net-mvc-website

http://yetanotherforum.net/forum/posts/t20572-C--ASP-NET-MVC-4-Application-YafMembershipProvider-Integration
Offline tha_watcha  
#3 Posted : 12 November 2018 03:05:37(UTC)
tha_watcha


Rank: YAF.NET Project Lead

Reputation:

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(UTC)
Posts: 3,923
Germany

Thanks: 73 times
Was thanked: 1190 time(s) in 1020 post(s)
Originally Posted by: Antelopetube Go to Quoted Post
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

Rss Feed  Atom Feed
Users browsing this topic
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.

Notification

Icon
Error