Search code examples
iistridiontridion-2011

Getting BadImageFormatException exception for "netrtsn" in my Tridion 2011 application


The below line code is giving exception when when we are trying to make Component Link object:

Tridion Application Code:

string strUrl = String.Empty;
ComponentLink comp = new ComponentLink(strUrl);

Exception:

System.BadImageFormatException was caught
  Message="An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)"
  Source="netrtsn"
  StackTrace:
       at Codemesh.JuggerNET.NativeInterface.GetJvmLoader(Int32 ctorVersion, String configFile, String vers, String conf, String reserved, Boolean bEnvOverrides, Boolean bDefaultJvm, Int32 traceFacility, Int32 traceLevel, Int32& error)
       at Codemesh.JuggerNET.JvmLoader.GetJvmLoader(Boolean bEnvOverrides, Boolean bDefaultJvm, TraceFacility fac, TraceLevel level)
       at Codemesh.JuggerNET.JvmLoader.GetJvmLoader()
       at Codemesh.JuggerNET.NativeInterface.ToJavaStringPinning(String str, Int32 length, IntPtr& result)
       at Codemesh.JuggerNET.NativeInterface.ToJavaString(String str)
       at Codemesh.JuggerNET.JavaMethodArguments.Add_string(String str)
       at Codemesh.JuggerNET.JavaMethodArguments.Add(Object obj, Type type)
       at Codemesh.JuggerNET.JavaMethodArguments.Add(Object obj)
       at Com.Tridion.Linking.ComponentLink..ctor(String publicationURI)
       at Tridion.ContentDelivery.Web.Linking.ComponentLink..ctor(String publicationUri)
       at ResxBind.ResolveLink(String strTcmUri) in F:\Share\Rajeev\Tridion2011\IntegrationLayer\Com.Emirates.Pss.Ibe.UILib\CommonAPI.cs:line 2077

As per the exception it would be something related to old DLLs, however I have removed all the references with lastest Tridion 2011 Dlls.

Please suggest, its very embrassing!!

Thanks.

Best Regards,

MS


Solution

  • I think netrtsn is compiled using AnyCpu, but it does have a dependency on xmogrt.dll for which there are specific DLL's for 32 or 64 bits

    These are available on your Tridion Installation Media, under /Content Delivery/roles/dotNet

    Please also check that all the following are either 32 or 64 bits:

    • Your Application pool (in case of 32 bits is that enabled)
    • Your Installed Java version
    • Any Dll's you provide yourself