Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could not load 'System.Core, Version 2.0.5.0' #128

Closed
uchitha opened this issue Apr 4, 2014 · 9 comments · Fixed by #129
Closed

Could not load 'System.Core, Version 2.0.5.0' #128

uchitha opened this issue Apr 4, 2014 · 9 comments · Fixed by #129

Comments

@uchitha
Copy link

uchitha commented Apr 4, 2014

Hi,

I'm observing the above exception running Humanizer 1.11.3.0 on a production box with IIS6/.Net 4 / ASP.Net MVC 3.

Found a similar issue reported with AutoMapper (AutoMapper/AutoMapper#383) and wondering whether it could be the same root cause.

Complete stack trace follows;

[FileLoadException: Could not load file or assembly 'System.Core, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e, Retargetable=Yes' or one of its dependencies. The given assembly name or codebase was invalid. (Exception from HRESULT: 0x80131047)]
Humanizer.TimeSpanHumanizeExtensions.Humanize(TimeSpan timeSpan, Int32 precision) +0
BHP.ROS.Statusboard.DAL.Ampla.Dtos.DowntimeDto.get_DurationText() +177

[TargetInvocationException: Exception has been thrown by the target of an invocation.]
System.RuntimeMethodHandle._InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeType typeOwner) +0
System.RuntimeMethodHandle.InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeType typeOwner) +152
System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks) +393
System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +38
System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters) +35
System.Web.Script.Serialization.JavaScriptSerializer.SerializeCustomObject(Object o, StringBuilder sb, Int32 depth, Hashtable objectsInUse, SerializationFormat serializationFormat) +763
System.Web.Script.Serialization.JavaScriptSerializer.SerializeValueInternal(Object o, StringBuilder sb, Int32 depth, Hashtable objectsInUse, SerializationFormat serializationFormat) +1692
System.Web.Script.Serialization.JavaScriptSerializer.SerializeValue(Object o, StringBuilder sb, Int32 depth, Hashtable objectsInUse, SerializationFormat serializationFormat) +146
System.Web.Script.Serialization.JavaScriptSerializer.SerializeEnumerable(IEnumerable enumerable, StringBuilder sb, Int32 depth, Hashtable objectsInUse, SerializationFormat serializationFormat) +182
System.Web.Script.Serialization.JavaScriptSerializer.SerializeValueInternal(Object o, StringBuilder sb, Int32 depth, Hashtable objectsInUse, SerializationFormat serializationFormat) +1647
System.Web.Script.Serialization.JavaScriptSerializer.SerializeValue(Object o, StringBuilder sb, Int32 depth, Hashtable objectsInUse, SerializationFormat serializationFormat) +146
System.Web.Script.Serialization.JavaScriptSerializer.SerializeDictionary(IDictionary o, StringBuilder sb, Int32 depth, Hashtable objectsInUse, SerializationFormat serializationFormat) +663
System.Web.Script.Serialization.JavaScriptSerializer.SerializeValueInternal(Object o, StringBuilder sb, Int32 depth, Hashtable objectsInUse, SerializationFormat serializationFormat) +1576
System.Web.Script.Serialization.JavaScriptSerializer.SerializeValue(Object o, StringBuilder sb, Int32 depth, Hashtable objectsInUse, SerializationFormat serializationFormat) +146
System.Web.Script.Serialization.JavaScriptSerializer.Serialize(Object obj, SerializationFormat serializationFormat) +117
System.Web.Mvc.JsonResult.ExecuteResult(ControllerContext context) +280
System.Web.Mvc.<>c__DisplayClass1c.<InvokeActionResultWithFilters>b__19() +33
System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func1 continuation) +784900 System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList1 filters, ActionResult actionResult) +265
System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) +784976
System.Web.Mvc.Controller.ExecuteCore() +159
System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext) +335
System.Web.Mvc.<>c__DisplayClassb.<BeginProcessRequest>b__5() +62
System.Web.Mvc.Async.<>c__DisplayClass1.<MakeVoidDelegate>b__0() +20
System.Web.Mvc.<>c__DisplayClasse.<EndProcessRequest>b__d() +54
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +453
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +371

@MehdiK
Copy link
Member

MehdiK commented Apr 4, 2014

Hi @uchitha,

Thanks for reporting this. I haven't seen this issue before; neither myself nor reported. I will try something to see if it makes a difference.

@MehdiK
Copy link
Member

MehdiK commented Apr 4, 2014

Alright. I just released v1.16.4 to NuGet with a potential fix. Please give that a shot and let me know if it makes any difference.

P.S. Didn't mean to close this. Got closed by GitHub on the merge of the PR.

@MehdiK MehdiK reopened this Apr 4, 2014
@MehdiK
Copy link
Member

MehdiK commented Apr 6, 2014

Have you had a chance to give this a shot @uchitha?

@uchitha
Copy link
Author

uchitha commented Apr 6, 2014

Mehdi,

Will check this out once I go to office tomorrow and get access to this server. Thanks for the quick fix.

@MehdiK
Copy link
Member

MehdiK commented Apr 6, 2014

Thanks. Let's hope this is a fix :)

@uchitha
Copy link
Author

uchitha commented Apr 7, 2014

Hi Mehdi,

The update didn't fix the problem unfortunately. Let me give you a few more details.

The server having the error has only up to .Net framework 4.0 (Beside being Win2003/IIS6). The other servers having .Net framework 4.5 (Beside being Win2008/IIS 7.5) are fine.

@MehdiK
Copy link
Member

MehdiK commented Apr 7, 2014

I am not sure tbh. Have you tried patching your server with this as per the link you sent?

@uchitha
Copy link
Author

uchitha commented Apr 7, 2014

That's the issue as I don't have the ownership over server configuration.

So may be as per the issue with Automapper (AutoMapper/AutoMapper#383) there are 2 potential fixes.

  1. Install the patch - http://stackoverflow.com/questions/13871267/unable-to-resolve-assemblies-that-use-portable-class-libraries
    OR
  2. Dynamically load the assemblies

Both of which is not possible for me. So for the time being I've disabled Humanizer.

@MehdiK
Copy link
Member

MehdiK commented Apr 7, 2014

Ah, ok. Sorry it didn't work out :(

Hopefully you can use Humanizer in a future project :)

@MehdiK MehdiK closed this as completed Apr 7, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants