Hello,
I’m having difficulty with a map rendering, and believe it may be related to an update to Visual Studio 2015.
I had the application compiled and running on my development machine on Monday - and checked in all of the source code. Tuesday I had the box upgraded to Visual Studio 2015 Update 1; after which, when I run the application - code unchanged - I get a gdi+ error. One of the other developers upstairs (with Visual Studio 2015 “Release” (no update)) is able to run the application fine (other than “unlicensed” displays - he doesn’t have a ThinkGeo license installed) - but he does not get an exception.
(Edit: I apologize - should have specified: MapSuite 9 - using latest version as of 1/27/2016; then today downloaded daily build for 2/2/2016)
Am I correct in thinking this error / raised exception is related to applying Visual Studio 2015 Update 1 ?
Compiling for .Net Framework 4.5.2
Here is the offending line from a .cshtml page. (I’ve cut out the rest of the page - this is the line where the debugger stops:
(from below) Html.ThinkGeo().Map(Model.Map).Render();
@using ThinkGeo.MapSuite.MvcEdition
@using ThinkGeo.MapSuite.Core
@model IHCB.Web.Models.MapViewModel
@{
Html.ThinkGeo().Map(Model.Map).Render();
}
All of these calls are directly to ThinkGeo objects - except Model --> I will also paste the code for the class being sent in as @Model
using System;
using System.Collections.Generic;
using System.Web.Mvc;
using ThinkGeo.MapSuite.MvcEdition;
namespace IHCB.Web.Models
{
public class MapViewModel
{
public Map Map { get; set; }
public MapDetailsViewModel MapDetails { get; set; }
public int SelectedMapIndex { get; set; }
public List<string> MapNames { get; set; }</string>
public List<mapstyles> MapStyles { get; set; }</mapstyles>
public List<layerswitcheritem> LayerSwitcher { get; set; }</layerswitcheritem>
public List<soenviewmodel> Soens { get; set; }</soenviewmodel>
public MapViewModel()
{
this.MapNames = new List<string>();
this.MapStyles = new List<mapstyles>();
this.LayerSwitcher = new List<layerswitcheritem>();
this.Soens = new List<soenviewmodel>();
}
}
}</soenviewmodel></layerswitcheritem></mapstyles></string>
The specific error I get is:
An exception of type ‘System.Runtime.InteropServices.ExternalException’ occurred in System.Drawing.dll but was not handled in user code
Additional information: A generic error occurred in GDI+.
System.Runtime.InteropServices.ExternalException: A generic error occurred in GDI+.
System.Runtime.InteropServices.ExternalException (0x80004005): A generic error occurred in GDI+.
at System.Drawing.Image.Save(String filename, ImageCodecInfo encoder, EncoderParameters encoderParams)
at System.Drawing.Image.Save(String filename, ImageFormat format)
at System.Drawing.Image.Save(String filename)
at qhM=.oRU=.pBU=(ViewContext viewContext, Type type)
at ThinkGeo.MapSuite.MvcEdition.MapBuilder…ctor(Map map, ViewContext viewContext)
at ThinkGeo.MapSuite.MvcEdition.MvcControlCollection.Map(Map map)
at ASP._Page_Views_Board_Index_cshtml.Execute() in c:\Code\IH Comm Boards\Development\v1.0-1\IHCB\IHCB\IHCB.Web\Views\Board\Index.cshtml:line 87
at System.Web.WebPages.WebPageBase.ExecutePageHierarchy()
at System.Web.Mvc.WebViewPage.ExecutePageHierarchy()
at System.Web.WebPages.StartPage.RunPage()
at System.Web.WebPages.StartPage.ExecutePageHierarchy()
at System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage)
at System.Web.Mvc.RazorView.RenderView(ViewContext viewContext, TextWriter writer, Object instance)
at System.Web.Mvc.BuildManagerCompiledView.Render(ViewContext viewContext, TextWriter writer)
at System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context)
at System.Web.Mvc.ControllerActionInvoker.InvokeActionResult(ControllerContext controllerContext, ActionResult actionResult)
at System.Web.Mvc.ControllerActionInvoker.<>c__DisplayClass1a.<invokeactionresultwithfilters>b__17()
at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation)
at System.Web.Mvc.ControllerActionInvoker.<>c__DisplayClass1a.<>c__DisplayClass1c.<invokeactionresultwithfilters>b__19()
at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation)
at System.Web.Mvc.ControllerActionInvoker.<>c__DisplayClass1a.<>c__DisplayClass1c.<invokeactionresultwithfilters>b__19()
at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation)
at System.Web.Mvc.ControllerActionInvoker.<>c__DisplayClass1a.<>c__DisplayClass1c.<invokeactionresultwithfilters>b__19()
at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation)
at System.Web.Mvc.ControllerActionInvoker.<>c__DisplayClass1a.<>c__DisplayClass1c.<invokeactionresultwithfilters>b__19()
at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation)
at System.Web.Mvc.ControllerActionInvoker.<>c__DisplayClass1a.<>c__DisplayClass1c.<invokeactionresultwithfilters>b__19()
at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation)
at System.Web.Mvc.ControllerActionInvoker.<>c__DisplayClass1a.<>c__DisplayClass1c.<invokeactionresultwithfilters>b__19()
at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList`1 filters, ActionResult actionResult)
at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass25.<>c__DisplayClass2a.<begininvokeaction>b__20()
at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass25.<begininvokeaction>b__22(IAsyncResult asyncResult)
at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult`1.End()
at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult)
at System.Web.Mvc.Controller.<>c__DisplayClass1d.<beginexecutecore>b__18(IAsyncResult asyncResult)
at System.Web.Mvc.Async.AsyncResultWrapper.<>c__DisplayClass4.<makevoiddelegate>b__3(IAsyncResult ar)
at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult`1.End()
at System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult)
at System.Web.Mvc.Async.AsyncResultWrapper.<>c__DisplayClass4.<makevoiddelegate>b__3(IAsyncResult ar)
at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult`1.End()
at System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult)
at System.Web.Mvc.Controller.System.Web.Mvc.Async.IAsyncController.EndExecute(IAsyncResult asyncResult)
at System.Web.Mvc.MvcHandler.<>c__DisplayClass8.<beginprocessrequest>b__3(IAsyncResult asyncResult)
at System.Web.Mvc.Async.AsyncResultWrapper.<>c__DisplayClass4.<makevoiddelegate>b__3(IAsyncResult ar)
at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult`1.End()
at System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult)
at System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result)
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
</makevoiddelegate></beginprocessrequest></makevoiddelegate></makevoiddelegate></beginexecutecore></begininvokeaction></begininvokeaction></invokeactionresultwithfilters></invokeactionresultwithfilters></invokeactionresultwithfilters></invokeactionresultwithfilters></invokeactionresultwithfilters></invokeactionresultwithfilters></invokeactionresultwithfilters>