# Error Loading Mr Sid Raster Layer

**URL:** <https://community.thinkgeo.com/t/error-loading-mr-sid-raster-layer/1543>\
**Category:** WinForms\
**Created:** [January 4, 2011, 9:33am UTC](https://community.thinkgeo.com/t/error-loading-mr-sid-raster-layer/1543 "2011-01-04T09:33:53Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Steven1](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/steven1/32/26943_2.png) [@Steven1](https://community.thinkgeo.com/u/Steven1)\
**Post date:** [January 4, 2011, 9:33am UTC](https://community.thinkgeo.com/t/error-loading-mr-sid-raster-layer/1543/1 "2011-01-04T09:33:53Z")

</div>

Hi,

I&nbsp;am&nbsp;using&nbsp;the&nbsp;full&nbsp;version&nbsp;of&nbsp;Desktop&nbsp;4.5.0.0.&nbsp;I&nbsp;am&nbsp;trying&nbsp;to&nbsp;load&nbsp;a&nbsp;MrSid&nbsp;raster&nbsp;layer&nbsp;using&nbsp;the&nbsp;following&nbsp;code:

`      oRasterLayer = New MrSidRasterLayer("C:\Data\IFMS\Org141\WOODVILLE_NE.sid")      oRasterLayer.LowerThreshold = 0      oRasterLayer.UpperThreshold = Double.MaxValue      oOverlay.Layers.Add(oRasterLayer)      WinformsMap1.Overlays.Add("RasterLayer", oOverlay)      With oRasterLayer         .Open()         WinformsMap1.CurrentExtent = .GetBoundingBox         .Close()      End With      WinformsMap1.Refresh()`

When&nbsp;the&nbsp;raster&nbsp;layer&nbsp;is&nbsp;opened&nbsp;(using&nbsp;the&nbsp;Open&nbsp;method)&nbsp;or&nbsp;the&nbsp;map&nbsp;refreshes&nbsp;I&nbsp;always&nbsp;get&nbsp;the&nbsp;same&nbsp;error:

System.IO.FileLoadException&nbsp;was&nbsp;unhandled&nbsp;&nbsp;&nbsp;Message=Mixed&nbsp;mode&nbsp;assembly&nbsp;is&nbsp;built&nbsp;against&nbsp;version&nbsp;'v2.0.50727'&nbsp;of&nbsp;the&nbsp;runtime&nbsp;and&nbsp;cannot&nbsp;be&nbsp;loaded&nbsp;in&nbsp;the&nbsp;4.0&nbsp;runtime&nbsp;without&nbsp;additional&nbsp;configuration&nbsp;information.&nbsp;&nbsp;&nbsp;Source=mscorlib&nbsp;&nbsp;&nbsp;StackTrace:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at&nbsp;System.Reflection.RuntimeAssembly.\_nLoad(AssemblyName&nbsp;fileName,&nbsp;String&nbsp;codeBase,&nbsp;Evidence&nbsp;assemblySecurity,&nbsp;RuntimeAssembly&nbsp;locationHint,&nbsp;StackCrawlMark&&nbsp;stackMark,&nbsp;Boolean&nbsp;throwOnFileNotFound,&nbsp;Boolean&nbsp;forIntrospection,&nbsp;Boolean&nbsp;suppressSecurityChecks)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at&nbsp;System.Reflection.RuntimeAssembly.nLoad(AssemblyName&nbsp;fileName,&nbsp;String&nbsp;codeBase,&nbsp;Evidence&nbsp;assemblySecurity,&nbsp;RuntimeAssembly&nbsp;locationHint,&nbsp;StackCrawlMark&&nbsp;stackMark,&nbsp;Boolean&nbsp;throwOnFileNotFound,&nbsp;Boolean&nbsp;forIntrospection,&nbsp;Boolean&nbsp;suppressSecurityChecks)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at&nbsp;System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName&nbsp;assemblyRef,&nbsp;Evidence&nbsp;assemblySecurity,&nbsp;StackCrawlMark&&nbsp;stackMark,&nbsp;Boolean&nbsp;forIntrospection,&nbsp;Boolean&nbsp;suppressSecurityChecks)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at&nbsp;System.Reflection.RuntimeAssembly.InternalLoadFrom(String&nbsp;assemblyFile,&nbsp;Evidence&nbsp;securityEvidence,&nbsp;Byte[]&nbsp;hashValue,&nbsp;AssemblyHashAlgorithm&nbsp;hashAlgorithm,&nbsp;Boolean&nbsp;forIntrospection,&nbsp;Boolean&nbsp;suppressSecurityChecks,&nbsp;StackCrawlMark&&nbsp;stackMark)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at&nbsp;System.Reflection.Assembly.LoadFrom(String&nbsp;assemblyFile)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at&nbsp;ThinkGeo.MapSuite.Core.xbde0958acd0fe179..ctor()&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at&nbsp;ThinkGeo.MapSuite.Core.MrSidRasterSource.OpenCore()&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at&nbsp;ThinkGeo.MapSuite.Core.RasterSource.Open()&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at&nbsp;ThinkGeo.MapSuite.Core.RasterLayer.OpenCore()&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at&nbsp;ThinkGeo.MapSuite.Core.Layer.Open()&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at&nbsp;ThinkGeo.MapSuite.DesktopEdition.LayerOverlay.DrawCore(GeoCanvas&nbsp;canvas)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at&nbsp;ThinkGeo.MapSuite.DesktopEdition.Overlay.MainDraw(GeoCanvas&nbsp;canvas)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at&nbsp;ThinkGeo.MapSuite.DesktopEdition.Overlay.Draw(GeoCanvas&nbsp;canvas)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at&nbsp;ThinkGeo.MapSuite.DesktopEdition.WinformsMap.x03e3d48bcfe7bb6c(IEnumerable`1&nbsp;xa6f0db4f183189f1)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at&nbsp;ThinkGeo.MapSuite.DesktopEdition.WinformsMap.xff5b27c00f9678c2(RectangleShape&nbsp;x178b193eec228e6e)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at&nbsp;ThinkGeo.MapSuite.DesktopEdition.WinformsMap.xe3cee4adb9c72451()&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at&nbsp;ThinkGeo.MapSuite.DesktopEdition.WinformsMap.x9ac8c50f434f4b39(Int32&nbsp;xb565f4681f05557a)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at&nbsp;ThinkGeo.MapSuite.DesktopEdition.WinformsMap.Refresh()&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at&nbsp;MapTutorial.MainForm.LoadData()&nbsp;in&nbsp;C:\Users\steller\Documents\Visual&nbsp;Studio&nbsp;2010\Projects\MapTutorial\MainForm.vb:line&nbsp;181&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at&nbsp;MapTutorial.MainForm.MainForm\_Load(Object&nbsp;sender,&nbsp;EventArgs&nbsp;e)&nbsp;in&nbsp;C:\Users\steller\Documents\Visual&nbsp;Studio&nbsp;2010\Projects\MapTutorial\MainForm.vb:line&nbsp;45&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at&nbsp;System.EventHandler.Invoke(Object&nbsp;sender,&nbsp;EventArgs&nbsp;e)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at&nbsp;System.Windows.Forms.Form.OnLoad(EventArgs&nbsp;e)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at&nbsp;System.Windows.Forms.Form.OnCreateControl()&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at&nbsp;System.Windows.Forms.Control.CreateControl(Boolean&nbsp;fIgnoreVisible)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at&nbsp;System.Windows.Forms.Control.CreateControl()&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at&nbsp;System.Windows.Forms.Control.WmShowWindow(Message&&nbsp;m)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at&nbsp;System.Windows.Forms.Control.WndProc(Message&&nbsp;m)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at&nbsp;System.Windows.Forms.ScrollableControl.WndProc(Message&&nbsp;m)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at&nbsp;System.Windows.Forms.Form.WmShowWindow(Message&&nbsp;m)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at&nbsp;System.Windows.Forms.Form.WndProc(Message&&nbsp;m)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at&nbsp;System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message&&nbsp;m)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at&nbsp;System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message&&nbsp;m)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at&nbsp;System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr&nbsp;hWnd,&nbsp;Int32&nbsp;msg,&nbsp;IntPtr&nbsp;wparam,&nbsp;IntPtr&nbsp;lparam)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at&nbsp;System.Windows.Forms.SafeNativeMethods.ShowWindow(HandleRef&nbsp;hWnd,&nbsp;Int32&nbsp;nCmdShow)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at&nbsp;System.Windows.Forms.Control.SetVisibleCore(Boolean&nbsp;value)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at&nbsp;System.Windows.Forms.Form.SetVisibleCore(Boolean&nbsp;value)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at&nbsp;System.Windows.Forms.Control.set\_Visible(Boolean&nbsp;value)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at&nbsp;System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32&nbsp;reason,&nbsp;ApplicationContext&nbsp;context)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at&nbsp;System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32&nbsp;reason,&nbsp;ApplicationContext&nbsp;context)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at&nbsp;System.Windows.Forms.Application.Run(ApplicationContext&nbsp;context)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at&nbsp;Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at&nbsp;Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at&nbsp;Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[]&nbsp;commandLine)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at&nbsp;MapTutorial.My.MyApplication.Main(String[]&nbsp;Args)&nbsp;in&nbsp;17d14f5c-a337-4978-8281-53493378c1071.vb:line&nbsp;81&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at&nbsp;System.AppDomain.\_nExecuteAssembly(RuntimeAssembly&nbsp;assembly,&nbsp;String[]&nbsp;args)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at&nbsp;System.AppDomain.ExecuteAssembly(String&nbsp;assemblyFile,&nbsp;Evidence&nbsp;assemblySecurity,&nbsp;String[]&nbsp;args)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at&nbsp;Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at&nbsp;System.Threading.ThreadHelper.ThreadStart\_Context(Object&nbsp;state)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at&nbsp;System.Threading.ExecutionContext.Run(ExecutionContext&nbsp;executionContext,&nbsp;ContextCallback&nbsp;callback,&nbsp;Object&nbsp;state,&nbsp;Boolean&nbsp;ignoreSyncCtx)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at&nbsp;System.Threading.ExecutionContext.Run(ExecutionContext&nbsp;executionContext,&nbsp;ContextCallback&nbsp;callback,&nbsp;Object&nbsp;state)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at&nbsp;System.Threading.ThreadHelper.ThreadStart()&nbsp;&nbsp;&nbsp;InnerException:

Any&nbsp;idea&nbsp;what&nbsp;the&nbsp;problem&nbsp;is?

Thanks,

Steve

---

<div class="post-metadata">

**Author:** ![Steven1](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/steven1/32/26943_2.png) [@Steven1](https://community.thinkgeo.com/u/Steven1)\
**Post date:** [January 4, 2011, 12:30pm UTC](https://community.thinkgeo.com/t/error-loading-mr-sid-raster-layer/1543/2 "2011-01-04T12:30:18Z")

</div>

Here’s&nbsp;a&nbsp;clue.&nbsp;&nbsp;The&nbsp;same&nbsp;MrSid&nbsp;layer&nbsp;opens&nbsp;OK&nbsp;in&nbsp;the&nbsp;‘How&nbsp;Do&nbsp;I’&nbsp;&nbsp;samples.&nbsp;&nbsp;The&nbsp;‘How&nbsp;Do&nbsp;I’&nbsp;project&nbsp;references&nbsp;the&nbsp;3.5&nbsp;.NET&nbsp;framework&nbsp;and&nbsp;I&nbsp;am&nbsp;using&nbsp;4.0.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Steve

---

<div class="post-metadata">

**Author:** ![Steven1](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/steven1/32/26943_2.png) [@Steven1](https://community.thinkgeo.com/u/Steven1)\
**Post date:** [January 4, 2011, 2:21pm UTC](https://community.thinkgeo.com/t/error-loading-mr-sid-raster-layer/1543/3 "2011-01-04T14:21:49Z")

</div>

I&nbsp;have&nbsp;answered&nbsp;my&nbsp;own&nbsp;question.&nbsp;&nbsp;I&nbsp;needed&nbsp;to&nbsp;add&nbsp;a&nbsp;line&nbsp;to&nbsp;my&nbsp;App.config&nbsp;file&nbsp;to&nbsp;enable&nbsp;the&nbsp;use&nbsp;of&nbsp;older&nbsp;.NET&nbsp;frameworks.&nbsp;&nbsp;Here&nbsp;is&nbsp;the&nbsp;line&nbsp;I&nbsp;added:&nbsp;  
  
` <startup useLegacyV2RuntimeActivationPolicy="true" >  </startup>`&nbsp;Hope&nbsp;this&nbsp;helps&nbsp;somebody.

---

<div class="post-metadata">

**Author:** ![ThinkGeo](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/thinkgeo/32/25029_2.png) [@ThinkGeo](https://community.thinkgeo.com/u/ThinkGeo)\
**Post date:** [January 5, 2011, 3:22am UTC](https://community.thinkgeo.com/t/error-loading-mr-sid-raster-layer/1543/4 "2011-01-05T03:22:13Z")

</div>

Steven,&nbsp;  
&nbsp;&nbsp;  
&nbsp;I&nbsp;am&nbsp;glad&nbsp;you&nbsp;fix&nbsp;it&nbsp;by&nbsp;yourself&nbsp;and&nbsp;also&nbsp;thank&nbsp;you&nbsp;for&nbsp;your&nbsp;sharing.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Thanks&nbsp;  
&nbsp;James
