2013-07-24 1 views
0

나는 최근에 DotNetNuke의 6가 .NET 4 프레임 워크 설치 전환하고, 나는 다음과 같은 오류 받기 시작했습니다 :이 오류가 난 서로를 재현 할 수 있기 때문에 발생하는 이유는 아무 생각이.net 프레임 워크 4에서 리소스 어셈블리를 찾을 수 없음 예외를 잡는 방법?

DotNetNuke.Services.Exceptions.PageLoadException: Exception has been thrown by the target of an invocation. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.IO.FileNotFoundException: Could not find file 'Telerik.Web.UI.resources'. 
at System.Reflection.RuntimeAssembly.InternalGetSatelliteAssembly(String name, CultureInfo culture, Version version, Boolean throwOnFileNotFound, StackCrawlMark& stackMark) 
at System.Resources.ManifestBasedResourceGroveler.GetSatelliteAssembly(CultureInfo lookForCulture, StackCrawlMark& stackMark) 
at System.Resources.ManifestBasedResourceGroveler.GrovelForResourceSet(CultureInfo culture, Dictionary`2 localResourceSets, Boolean tryParents, Boolean createIfNotExists, StackCrawlMark& stackMark) 
at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo requestedCulture, Boolean createIfNotExists, Boolean tryParents, StackCrawlMark& stackMark) 
at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents) 
at System.Resources.ResourceManager.GetString(String name, CultureInfo culture) 
at Telerik.Web.LocalizationProvider.EmbeddedResourceLocator.GetString(String resourceKey) 
at Telerik.Web.LocalizationStrings.GetString(String key, Boolean throwErrorIfMissing) 
at Telerik.Web.LocalizationStrings.GetString(String key) 
at Telerik.Web.UI.ComboBoxStrings.get_AllItemsCheckedString() --- End of inner exception stack trace --- 
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) 
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments) 
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) 
at System.Web.SecurityUtils.MethodInfoInvoke(MethodInfo method, Object target, Object[] args) 
at System.Web.Script.Serialization.JavaScriptSerializer.SerializeCustomObject(Object o, StringBuilder sb, Int32 depth, Hashtable objectsInUse, SerializationFormat serializationFormat) 
at System.Web.Script.Serialization.JavaScriptSerializer.SerializeValueInternal(Object o, StringBuilder sb, Int32 depth, Hashtable objectsInUse, SerializationFormat serializationFormat, MemberInfo currentMember) 
at System.Web.Script.Serialization.JavaScriptSerializer.SerializeValue(Object o, StringBuilder sb, Int32 depth, Hashtable objectsInUse, SerializationFormat serializationFormat, MemberInfo currentMember) 
at System.Web.Script.Serialization.JavaScriptSerializer.Serialize(Object obj, StringBuilder output, SerializationFormat serializationFormat) 
at System.Web.Script.Serialization.JavaScriptSerializer.Serialize(Object obj, SerializationFormat serializationFormat) 
at Telerik.Web.UI.RadComboBox.DescribeComponent(IScriptDescriptor descriptor) 
at Telerik.Web.UI.RadDataBoundControl.Telerik.Web.IControl.DescribeComponent(IScriptDescriptor descriptor) 
at Telerik.Web.UI.ScriptRegistrar.GetScriptDescriptors(Control control) 
at Telerik.Web.UI.RadDataBoundControl.GetScriptDescriptors() 
at Telerik.Web.UI.RadDataBoundControl.System.Web.UI.IScriptControl.GetScriptDescriptors() 
at System.Web.UI.ScriptControlManager.RegisterScriptDescriptors(IScriptControl scriptControl) 
at Telerik.Web.UI.RadDataBoundControl.RegisterScriptDescriptors() 
at Telerik.Web.UI.RadDataBoundControl.Render(HtmlTextWriter writer) 
at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) 
at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) 
at System.Web.UI.Control.RenderControl <....snip, rendering call stack> 

을 서버 또는 심지어 같은 서버에 설치해야합니다. 나는 그것을 패치하기 위해 노력하고있어 해결책을 찾을 수 없기 때문에 그래서 난이 게시물에서 제안 된 해결 방법 바라 보았다 : http://social.msdn.microsoft.com/Forums/vstudio/en-US/32e458a1-7443-4309-a054-8839b33dfd4f/framework-40-dll-loaded-by-a-20-executable-cannot-find-xxxxresourcesdll

그래서 해결 방법은 내가 몇 가지 코드를 추가 할 수 있습니다

catch the FileNotFoundException in HostRuntime.ResolveAssembly and return null. This should prevent the process from crashing.

하는 것 HttpModule을 통해 응용 프로그램에,하지만 난 정말 HostRuntime.ResolveAssembly ... 어떤 생각을 패치 해야하는지 어떻게 보지 못하겠습니까?

try 
    { 
     runtimeAssembly = this._mediator.MainAssembly.InternalGetSatelliteAssembly(satelliteAssemblyName, lookForCulture, this._mediator.SatelliteContractVersion, false, ref stackMark); 
    } 
    catch (FileLoadException ex) 
    { 
     int hResult = ex._HResult; 
     Win32Native.MakeHRFromErrorCode(5); 
    } 
    catch (BadImageFormatException) 
    { 
    } 
:

SatelliteAssembly 로딩에 ManifestBasedResourceGroveler에서 호출은 다음과 같다 :


편집 : 나는 프레임 워크 4의 mscorlib에 어셈블리 은요 봤는데 정말 뭔가 이상한 참조

그래서 그것은 예외를 잡는다, 그러나 여기 InternalGetSatelliteAssembly

if (runtimeAssembly == this) 
    { 
     throw new FileNotFoundException(string.Format(culture, Environment.GetResourceString("IO.FileNotFound_FileName"), new object[] 
     { 
      assemblyName.Name 
     })); 
    } 
코드입니다

좋아, 그래서 잡히지 않을 것입니다 FileNotFoundException 얻을 것이다 ... 저에게 정말 이상한 행동처럼 보이는

답변

0

Telerik 버전 문제가 보이는 스택 추적을 기반으로합니다. 적절한 어셈블리가 모두로드 되었습니까?

+0

저는 퓨전 로그를보고 이상한 버전 번호를 보지 않았 음을 확신합니다. 로드 된 버전이 올바른지 확인하는 방법이 있습니까? – samy

+0

융합 로그를 다시 확인했는데 모든 버전이 프레임 워크 4와 일치하고 버전 번호와 일치한다는 점이 긍정적입니다. – samy

관련 문제