# HelloWortd: ArrayTypeMismatchException

**URL:** <https://community.thinkgeo.com/t/hellowortd-arraytypemismatchexception/4049>\
**Category:** MVC\
**Created:** [June 4, 2013, 9:32am UTC](https://community.thinkgeo.com/t/hellowortd-arraytypemismatchexception/4049 "2013-06-04T09:32:38Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![giuseppe](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/g/48db29/32.png) [@giuseppe](https://community.thinkgeo.com/u/giuseppe)\
**Post date:** [June 4, 2013, 9:32am UTC](https://community.thinkgeo.com/t/hellowortd-arraytypemismatchexception/4049/1 "2013-06-04T09:32:38Z")

</div>

&nbsp;Hi,

I&nbsp;just&nbsp;downloded&nbsp;the&nbsp;free&nbsp;Map&nbsp;suite&nbsp;MVC&nbsp;Edition,&nbsp;i'm&nbsp;building&nbsp;my&nbsp;first&nbsp;hello&nbsp;world&nbsp;application&nbsp;according&nbsp;the&nbsp;Quick&nbsp;Start&nbsp;Guide.&nbsp;I&nbsp;created&nbsp;an&nbsp;Empty&nbsp;&nbsp;MVC&nbsp;4&nbsp;Web&nbsp;Apllication&nbsp;(i&nbsp;don't&nbsp;have&nbsp;MVC&nbsp;3&nbsp;installed),&nbsp;i&nbsp;created&nbsp;the&nbsp;HomeController&nbsp;and&nbsp;the&nbsp;Index&nbsp;view.

Running&nbsp;the&nbsp;application&nbsp;i&nbsp;get&nbsp;the&nbsp;following&nbsp;error:

# Server&nbsp;Error&nbsp;in&nbsp;'/'&nbsp;Application. * * *
  

## _Tentativo&nbsp;di&nbsp;accedere&nbsp;a&nbsp;un&nbsp;elemento&nbsp;come&nbsp;tipo&nbsp;incompatibile&nbsp;con&nbsp;la&nbsp;matrice._
  

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; **&nbsp;Description:&nbsp;** An&nbsp;unhandled&nbsp;exception&nbsp;occurred&nbsp;during&nbsp;&nbsp;the&nbsp;execution&nbsp;of&nbsp;the&nbsp;current&nbsp;web&nbsp;request.&nbsp;Please&nbsp;review&nbsp;the&nbsp;stack&nbsp;trace&nbsp;&nbsp;for&nbsp;more&nbsp;information&nbsp;about&nbsp;the&nbsp;error&nbsp;and&nbsp;where&nbsp;it&nbsp;originated&nbsp;in&nbsp;the&nbsp;&nbsp;code.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  
  
  
  
**&nbsp;Exception&nbsp;Details:&nbsp;** System.ArrayTypeMismatchException:&nbsp;Tentativo&nbsp;di&nbsp;accedere&nbsp;a&nbsp;un&nbsp;elemento&nbsp;come&nbsp;tipo&nbsp;incompatibile&nbsp;con&nbsp;la&nbsp;matrice.  
  
  
  
**Source&nbsp;Error:** &nbsp;

&nbsp;&nbsp;&nbsp;&nbsp;  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`            Line 9:  Line 10:     @{Line 11:         Html.ThinkGeo().Map("Map1", 600, 500) Line 12:         .MapBackground(new BackgroundLayer(new GeoSolidBrush(GeoColor.FromHtml("#E5E3DF"))))Line 13:         .CurrentExtent(-131.22, 55.05, -54.03, 16.91)                        `

`               Source File:  d:\Repositories\Examples\MapHelloWorld\MapHelloWorld\Views\Home\Index.cshtml    Line:  11             Stack Trace: `

`
                                    [ArrayTypeMismatchException: Tentativo di accedere a un elemento come tipo incompatibile con la matrice.]   System.Collections.Generic.List`1.set_Item(Int32 index, T value) +30   System.Web.Routing.RouteCollection.SetItem(Int32 index, RouteBase item) +60   System.Collections.ObjectModel.Collection`1.set_Item(Int32 index, T value) +116   ThinkGeo.MapSuite.MvcEdition.HtmlHelperExtension.ThinkGeo(HtmlHelper helper) +58   ASP._Page_Views_Home_Index_cshtml.Execute() in d:\Repositories\Examples\MapHelloWorld\MapHelloWorld\Views\Home\Index.cshtml:11   System.Web.WebPages.WebPageBase.ExecutePageHierarchy() +207   System.Web.Mvc.WebViewPage.ExecutePageHierarchy() +97   System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) +76   System.Web.Mvc.RazorView.RenderView(ViewContext viewContext, TextWriter writer, Object instance) +258   System.Web.Mvc.BuildManagerCompiledView.Render(ViewContext viewContext, TextWriter writer) +115   System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context) +303   System.Web.Mvc.ControllerActionInvoker.InvokeActionResult(ControllerContext controllerContext, ActionResult actionResult) +13   System.Web.Mvc.<>c __DisplayClass1a.<InvokeActionResultWithFilters>b__ 17() +23   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) +260   System.Web.Mvc.<>c __DisplayClass1c.<InvokeActionResultWithFilters>b__ 19() +19   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList`1 filters, ActionResult actionResult) +177   System.Web.Mvc.Async.<>c __DisplayClass2a.<BeginInvokeAction>b__ 20() +92   System.Web.Mvc.Async.<>c __DisplayClass25.<BeginInvokeAction>b__ 22(IAsyncResult asyncResult) +126   System.Web.Mvc.Async.WrappedAsyncResult`1.End() +57   System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult) +45   System.Web.Mvc.<>c __DisplayClass1d.<BeginExecuteCore>b__ 18(IAsyncResult asyncResult) +14   System.Web.Mvc.Async.<>c __DisplayClass4.<MakeVoidDelegate>b__ 3(IAsyncResult ar) +25   System.Web.Mvc.Async.WrappedAsyncResult`1.End() +62   System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +61   System.Web.Mvc.Async.<>c __DisplayClass4.<MakeVoidDelegate>b__ 3(IAsyncResult ar) +25   System.Web.Mvc.Async.WrappedAsyncResult`1.End() +62   System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult) +49   System.Web.Mvc.Controller.System.Web.Mvc.Async.IAsyncController.EndExecute(IAsyncResult asyncResult) +10   System.Web.Mvc.<>c __DisplayClass8.<BeginProcessRequest>b__ 3(IAsyncResult asyncResult) +28   System.Web.Mvc.Async.<>c __DisplayClass4.<MakeVoidDelegate>b__ 3(IAsyncResult ar) +25   System.Web.Mvc.Async.WrappedAsyncResult`1.End() +62   System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +49   System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result) +9   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +8970141   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +184                        
Do i miss something?

HomeController.cs
using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.Mvc; namespace MapHelloWorld.Controllers{    public class HomeController : Controller    {        //        // GET: /Home/         public ActionResult Index()        {            return View();        }     }}Index.cshtml@using ThinkGeo.MapSuite.Core@using ThinkGeo.MapSuite.MvcEdition@{    ViewBag.Title = "Index";} <h2>Index</h2> <div>    @{        Html.ThinkGeo().Map("Map1", 600, 500)        .MapBackground(new BackgroundLayer(new GeoSolidBrush(GeoColor.FromHtml("#E5E3DF"))))        .CurrentExtent(-131.22, 55.05, -54.03, 16.91)        .MapUnit(GeographyUnit.DecimalDegree)        .CustomOverlays(overlays => overlays.WorldMapKitWmsWebOverlay())        .Render();    }</div>
 
`

---

<div class="post-metadata">

**Author:** ![Johnny](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/johnny/32/19044_2.png) [@Johnny](https://community.thinkgeo.com/u/Johnny)\
**Post date:** [June 5, 2013, 3:00am UTC](https://community.thinkgeo.com/t/hellowortd-arraytypemismatchexception/4049/2 "2013-06-05T03:00:39Z")

</div>

&nbsp;Hi&nbsp;Giuseppe,

Thanks&nbsp;for&nbsp;evaluating&nbsp;our&nbsp;products&nbsp;and&nbsp;welcome&nbsp;to&nbsp;the&nbsp;discussion&nbsp;forum.&nbsp;The&nbsp;problem&nbsp;is&nbsp;that&nbsp;some&nbsp;configurations&nbsp;of&nbsp;Asp.NET&nbsp;MVC4&nbsp;are&nbsp;missed&nbsp;in&nbsp;the&nbsp;web.config&nbsp;file&nbsp;when&nbsp;we&nbsp;take&nbsp;empty&nbsp;Mvc&nbsp;template.&nbsp;To&nbsp;resolve&nbsp;the&nbsp;problem,&nbsp;please&nbsp;add&nbsp;the&nbsp;following&nbsp;configuration&nbsp;to&nbsp;web.config,&nbsp;between&nbsp;"\<configuration\>&nbsp;...&nbsp;\</configuration\>":

&nbsp;&nbsp;\<runtime\>

&nbsp;&nbsp;&nbsp;&nbsp;\<assemblyBinding&nbsp;xmlns="urn:schemas-microsoft-com:asm.v1"\>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\<assemblyIdentity&nbsp;name="System.Web.Mvc"&nbsp;publicKeyToken="31bf3856ad364e35"&nbsp;/\>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\<bindingRedirect&nbsp;oldVersion="1.0.0.0-4.0.0.0"&nbsp;newVersion="4.0.0.0"&nbsp;/\>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\</dependentAssembly\>

&nbsp;&nbsp;&nbsp;&nbsp;\</assemblyBinding\>

&nbsp;

&nbsp;&nbsp;\</runtime\>

If&nbsp;it&nbsp;doesn't&nbsp;work&nbsp;for&nbsp;you,&nbsp;please&nbsp;do&nbsp;some&nbsp;changes&nbsp;to&nbsp;the&nbsp;"publicKeyToken"&nbsp;and&nbsp;the&nbsp;versions&nbsp;to&nbsp;make&nbsp;sure&nbsp;it&nbsp;fits&nbsp;the&nbsp;one&nbsp;you&nbsp;are&nbsp;using.

&nbsp;

Thanks,

Johnny

---

<div class="post-metadata">

**Author:** ![giuseppe](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/g/48db29/32.png) [@giuseppe](https://community.thinkgeo.com/u/giuseppe)\
**Post date:** [June 5, 2013, 10:02am UTC](https://community.thinkgeo.com/t/hellowortd-arraytypemismatchexception/4049/3 "2013-06-05T10:02:46Z")

</div>

Thanks&nbsp;Johnny&nbsp;for&nbsp;your&nbsp;help,&nbsp;now&nbsp;it&nbsp;works.  
  
  
  
In&nbsp;the&nbsp;xml&nbsp;you&nbsp;posted&nbsp;there&nbsp;was&nbsp;same&nbsp;tag&nbsp;error,&nbsp;this&nbsp;is&nbsp;the&nbsp;correct&nbsp;version:  
  
  
&nbsp;&nbsp;\<runtime\>  
&nbsp;&nbsp;&nbsp;&nbsp;\<assemblyBinding&nbsp;xmlns="urn:schemas-microsoft-com:asm.v1"\>  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\<dependentAssembly\>  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\<assemblyIdentity&nbsp;name="System.Web.Mvc"&nbsp;publicKeyToken="31bf3856ad364e35"&nbsp;/\>  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\<bindingRedirect&nbsp;oldVersion="1.0.0.0-4.0.0.0"&nbsp;newVersion="4.0.0.0"&nbsp;/\>  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\<&nbsp;/dependentAssembly\>  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\<&nbsp;/assemblyBinding\>  
&nbsp;&nbsp;&nbsp;\<&nbsp;/runtime\>  
  
Thanks,  
Giuseppe

---

<div class="post-metadata">

**Author:** ![Johnny](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/johnny/32/19044_2.png) [@Johnny](https://community.thinkgeo.com/u/Johnny)\
**Post date:** [June 6, 2013, 9:50am UTC](https://community.thinkgeo.com/t/hellowortd-arraytypemismatchexception/4049/4 "2013-06-06T09:50:41Z")

</div>

Hi&nbsp;Giuseppe,&nbsp;  
&nbsp;&nbsp;&nbsp;  
&nbsp;Great&nbsp;to&nbsp;hear&nbsp;the&nbsp;problem&nbsp;is&nbsp;solved,&nbsp;and&nbsp;thanks&nbsp;for&nbsp;your&nbsp;sharing,&nbsp;if&nbsp;you&nbsp;have&nbsp;any&nbsp;more&nbsp;question,&nbsp;please&nbsp;feel&nbsp;free&nbsp;to&nbsp;let&nbsp;us&nbsp;know.&nbsp;  
&nbsp;&nbsp;&nbsp;  
&nbsp;Best&nbsp;Regards&nbsp;  
&nbsp;&nbsp;&nbsp;  
&nbsp;Johnny
