allaire_
  •  allaire_
  • 52% (Neutral)
  • YAF Forumling Topic Starter
2014-01-27T19:57:43Z
Hello colleagues,

I am trying to integrate YAF and BlogEngine (the latest versions). I have already merged web.config files but, during the execution I receiveng quite strange error message:
Quote:


Could not load file or assembly 'Microsoft.Practices.ServiceLocation, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
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.FileNotFoundException: Could not load file or assembly 'Microsoft.Practices.ServiceLocation, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.

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 'Microsoft.Practices.ServiceLocation, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' could not be loaded.

WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].



Can somebody tell me what does this assembly means('Microsoft.Practices.ServiceLocation) and why I cannot find it in YAF solution (if it's required indeed)???

Stack trace:
Quote:


[FileNotFoundException: Could not load file or assembly 'Microsoft.Practices.ServiceLocation, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.]
System.Reflection.RuntimeAssembly.GetExportedTypes(RuntimeAssembly assembly, ObjectHandleOnStack retTypes) +0
System.Reflection.RuntimeAssembly.GetExportedTypes() +49
YAF.Core.<>c__DisplayClass2`1.<FindClassesWithAttribute>b__0(Assembly a) +26
System.Linq.WhereSelectArrayIterator`2.MoveNext() +82
YAF.Core.AssemblyExtensions.FindClassesWithAttribute(IEnumerable`1 assemblies) +328
YAF.Core.Modules.DynamicServicesModule.RegisterDynamicServices(Assembly[] assemblies) +175
YAF.Core.Modules.DynamicServicesModule.Load(ContainerBuilder containerBuilder) +30
YAF.Core.BaseModule.Configure(IComponentRegistry componentRegistry) +133
Autofac.ContainerBuilder.Build(IComponentRegistry componentRegistry, Boolean excludeDefaultModules) +127
YAF.Core.BaseModule.RegisterBaseModules(Assembly[] assemblies, IEnumerable`1 exclude) +600
YAF.Core.Modules.BootstrapModule.Load(ContainerBuilder builder) +126
YAF.Core.BaseModule.Configure(IComponentRegistry componentRegistry) +133
Autofac.ContainerBuilder.Build(IComponentRegistry componentRegistry, Boolean excludeDefaultModules) +127
Autofac.ContainerBuilder.Build(ContainerBuildOptions options) +61
YAF.Core.GlobalContainer..cctor() +10

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

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




!Merged Web.config file! 
Sponsor
Zero2Cool
2014-01-27T20:43:01Z
I don't remember seeing that assembly at all, but the link below might help you find it.

http://stackoverflow.com...ervicelocation-come-from 
tha_watcha
2014-01-28T12:46:49Z
Originally Posted by: allaire_ 

Hello colleagues,

I am trying to integrate YAF and BlogEngine (the latest versions). I have already merged web.config files but, during the execution I receiveng quite strange error message:

Quote:


Could not load file or assembly 'Microsoft.Practices.ServiceLocation, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
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.FileNotFoundException: Could not load file or assembly 'Microsoft.Practices.ServiceLocation, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.

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 'Microsoft.Practices.ServiceLocation, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' could not be loaded.

WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].



Can somebody tell me what does this assembly means('Microsoft.Practices.ServiceLocation) and why I cannot find it in YAF solution (if it's required indeed)???

Stack trace:
Quote:


[FileNotFoundException: Could not load file or assembly 'Microsoft.Practices.ServiceLocation, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.]
System.Reflection.RuntimeAssembly.GetExportedTypes(RuntimeAssembly assembly, ObjectHandleOnStack retTypes) +0
System.Reflection.RuntimeAssembly.GetExportedTypes() +49
YAF.Core.<>c__DisplayClass2`1.<FindClassesWithAttribute>b__0(Assembly a) +26
System.Linq.WhereSelectArrayIterator`2.MoveNext() +82
YAF.Core.AssemblyExtensions.FindClassesWithAttribute(IEnumerable`1 assemblies) +328
YAF.Core.Modules.DynamicServicesModule.RegisterDynamicServices(Assembly[] assemblies) +175
YAF.Core.Modules.DynamicServicesModule.Load(ContainerBuilder containerBuilder) +30
YAF.Core.BaseModule.Configure(IComponentRegistry componentRegistry) +133
Autofac.ContainerBuilder.Build(IComponentRegistry componentRegistry, Boolean excludeDefaultModules) +127
YAF.Core.BaseModule.RegisterBaseModules(Assembly[] assemblies, IEnumerable`1 exclude) +600
YAF.Core.Modules.BootstrapModule.Load(ContainerBuilder builder) +126
YAF.Core.BaseModule.Configure(IComponentRegistry componentRegistry) +133
Autofac.ContainerBuilder.Build(IComponentRegistry componentRegistry, Boolean excludeDefaultModules) +127
Autofac.ContainerBuilder.Build(ContainerBuildOptions options) +61
YAF.Core.GlobalContainer..cctor() +10

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

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




!Merged Web.config file! 



That is a bug, this will be fixed in the next release (2.1.1), if you are able to compile the source yourself you can apply the fix i committed here
https://github.com/YAFNE...3c9c5250af7ac3238c86a566 

UserPostedImage
allaire_
  •  allaire_
  • 52% (Neutral)
  • YAF Forumling Topic Starter
2014-01-28T14:10:11Z
Originally Posted by: tha_watcha 


That is a bug, this will be fixed in the next release (2.1.1), if you are able to compile the source yourself you can apply the fix i committed here
https://github.com/YAFNE...3c9c5250af7ac3238c86a566 



Hi tha_watcha,
Thank you for this fix indeed, it has helped me to solve this issue.
Unfortunately, there is appeared another one and I don't know what to do, as trace log contain too small amount of information:

Quote:


String reference not set to an instance of a String.
Parameter name: name
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.ArgumentNullException: String reference not set to an instance of a String.
Parameter name: name

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:

[ArgumentNullException: String reference not set to an instance of a String.
Parameter name: name]
System.Globalization.CultureInfo..ctor(String name, Boolean useUserOverride) +10694563
YAF.Core.Services.Localization.Localizer.InitCulture() +334
YAF.Core.Services.Localization.Localizer..ctor(String fileName) +59
YAF.Core.Services.Localization.YafLocalization.LoadTranslation(String fileName) +449
YAF.Core.Services.Localization.YafLocalization.LoadTranslation() +256
YAF.Core.Services.Localization.YafLocalization.GetLocalizedTextInternal(String page, String tag) +22
YAF.Core.Services.Localization.YafLocalization.GetText(String page, String tag) +26
YAF.Types.Interfaces.IHaveLocalizationExtensions.GetText(IHaveLocalization haveLocalization, String page, String tag) +85
YAF.Modules.PagePopupForumModule.AddErrorPopup() +122
YAF.Modules.PagePopupForumModule.ForumControl_Init(Object sender, EventArgs e) +5
System.Web.UI.Control.OnInit(EventArgs e) +92
System.Web.UI.UserControl.OnInit(EventArgs e) +83
YAF.Forum.OnInit(EventArgs e) +124
System.Web.UI.Control.InitRecursive(Control namingContainer) +134
System.Web.UI.Control.InitRecursive(Control namingContainer) +290
System.Web.UI.Control.InitRecursive(Control namingContainer) +290
System.Web.UI.Control.InitRecursive(Control namingContainer) +290
System.Web.UI.Control.InitRecursive(Control namingContainer) +290
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +489



By some reason debugger points to "YafContext.Current.BoardSettings.Culture" (please see detailed picture below):
[img="https://drive.google.com/file/d/0B5-9BqaCN3NLclN0Q3FMUTEwdzg/edit?usp=sharing"]Screenshot of debugger window[/img]
drive.google.com/file/d/0B5-9BqaCN3NLclN0Q3FMUTEwdzg/edit?usp=sharing
tha_watcha
2014-01-29T15:24:46Z
Thanks for the screenshot, i saw this error before. I look in to it soon. Is the yaf forum already installed (did you run the install wizzard yet?)
UserPostedImage
allaire_
  •  allaire_
  • 52% (Neutral)
  • YAF Forumling Topic Starter
2014-01-30T10:39:40Z
Originally Posted by: tha_watcha 

Thanks for the screenshot, i saw this error before. I look in to it soon. Is the yaf forum already installed (did you run the install wizzard yet?)



Hi tha_watcha,
Yes, the forum is installed (and configured through the wizard). Actually this error happening (very often) when I'm trying to change something in web.config file. It doesn't mean that web.config is wrong (as it doesn't matter what I change there). You can see web.config file in the attachment to my first post.
I found out that the only way to get rid of this error message is to run YAF configuration wizard again. To be honest I don't see much sense in this action, as I don't see any obvious connections/relations with the error message itself... quite weird.
The good news are:
- SSO works just fine;
- The forum, as a standalone instance (with merged web.config file) works fine as well, ie if I call it from the subfolder: /forum/default.aspx
- ShoutBox works fine in any cases :)
The bad ones:
- This weird error described above;
- Another error message, which probably related to the YAF component. I just mean here that if I try to built-in YAF component into existing master-page (page linked to BE master-page), like this:

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="forum.aspx.cs" Inherits="forum" EnableViewState="false" %>
<%@ Register TagPrefix="YAF" Assembly="YAF" Namespace="YAF" %>
<asp:content id="Content1" contentplaceholderid="cphBody" runat="Server">
    <YAF:Forum runat="server" ID="frm_board" BoardID="1">
    </YAF:Forum>
</asp:content>

In this case YAF behave weird when I try to reply to existing post ('reply form' suddenly changes to the 'post new topic' form):
Screenshot to prove this... 
When I try to change anything in the ' host administration' settings it crashes...
Error message (not quite informative) 

PS something has definitely changed, as version 2.0.0 of YAF is working fine together with BE rigth now on my website.

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