Hi,
I just downloded the free Map suite MVC Edition, i'm building my first hello world application according the Quick Start Guide. I created an Empty MVC 4 Web Apllication (i don't have MVC 3 installed), i created the HomeController and the Index view.
Running the application i get the following error:
Server Error in '/' Application.
Tentativo di accedere a un elemento come tipo incompatibile con la matrice.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.ArrayTypeMismatchException: Tentativo di accedere a un elemento come tipo incompatibile con la matrice.
Source Error:
Do i miss something? HomeController.cs
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
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>