# Runtime exceptions after upgrading from beta1 to beta2

**URL:** <https://community.thinkgeo.com/t/runtime-exceptions-after-upgrading-from-beta1-to-beta2/180>\
**Category:** WinForms\
**Created:** [January 23, 2009, 9:02am UTC](https://community.thinkgeo.com/t/runtime-exceptions-after-upgrading-from-beta1-to-beta2/180 "2009-01-23T09:02:39Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![charryman](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/charryman/32/25013_2.png) [@charryman](https://community.thinkgeo.com/u/charryman)\
**Post date:** [January 23, 2009, 9:02am UTC](https://community.thinkgeo.com/t/runtime-exceptions-after-upgrading-from-beta1-to-beta2/180/1 "2009-01-23T09:02:39Z")

</div>

Hi,

After&nbsp;upgrading&nbsp;from&nbsp;beta1&nbsp;to&nbsp;beta2&nbsp;i&nbsp;am&nbsp;struggling&nbsp;just&nbsp;to&nbsp;get&nbsp;stuff&nbsp;working&nbsp;again...&nbsp;Its&nbsp;becoming&nbsp;frustrating&nbsp;because&nbsp;I&nbsp;keep&nbsp;getting&nbsp;various&nbsp;exceptions&nbsp;and&nbsp;errors&nbsp;trying&nbsp;to&nbsp;do&nbsp;the&nbsp;exact&nbsp;same&nbsp;stuff&nbsp;i&nbsp;just&nbsp;had&nbsp;working&nbsp;previous&nbsp;to&nbsp;the&nbsp;update.&nbsp;&nbsp;The&nbsp;most&nbsp;current&nbsp;i&nbsp;keep&nbsp;hitting&nbsp;is:

**InvalidOperationException:&nbsp;**

&nbsp;"The&nbsp;GeoCanvas&nbsp;is&nbsp;currently&nbsp;not&nbsp;drawing.&nbsp;&nbsp;Please&nbsp;call&nbsp;the&nbsp;BeginDraw&nbsp;method&nbsp;before&nbsp;calling&nbsp;this&nbsp;method."

**Stack&nbsp;Trace:**

&nbsp;&nbsp;&nbsp;at&nbsp;ThinkGeo.MapSuite.Core.x6d719af406ea4c2c.xbc32d22242378f5c(Boolean&nbsp;x1c27a8ea53684488)  
  
&nbsp;&nbsp;&nbsp;at&nbsp;ThinkGeo.MapSuite.Core.GeoCanvas.get\_CurrentWorldExtent()  
  
&nbsp;&nbsp;&nbsp;at&nbsp;ThinkGeo.MapSuite.DesktopEdition.Overlay.Draw(GeoCanvas&nbsp;canvas)  
  
&nbsp;&nbsp;&nbsp;at&nbsp;ThinkGeo.MapSuite.DesktopEdition.xf0380b1a0bc40ca6.StartDraw()  
  
&nbsp;&nbsp;&nbsp;at&nbsp;ThinkGeo.MapSuite.DesktopEdition.x601a5561df898600.x7510a5c148e0acfd(Object&nbsp;x19b0b2213afc2289)  
  
&nbsp;&nbsp;&nbsp;at&nbsp;System.Threading.\_ThreadPoolWaitCallback.WaitCallback\_Context(Object&nbsp;state)  
  
&nbsp;&nbsp;&nbsp;at&nbsp;System.Threading.ExecutionContext.Run(ExecutionContext&nbsp;executionContext,&nbsp;ContextCallback&nbsp;callback,&nbsp;Object&nbsp;state)  
  
&nbsp;&nbsp;&nbsp;at&nbsp;System.Threading.\_ThreadPoolWaitCallback.PerformWaitCallbackInternal(\_ThreadPoolWaitCallback&nbsp;tpWaitCallBack)  
  
&nbsp;&nbsp;&nbsp;at&nbsp;System.Threading.\_ThreadPoolWaitCallback.PerformWaitCallback(Object&nbsp;state)

Anyone&nbsp;have&nbsp;any&nbsp;thoughts&nbsp;as&nbsp;to&nbsp;what&nbsp;might&nbsp;be&nbsp;causing&nbsp;this&nbsp;exception,&nbsp;I&nbsp;don't&nbsp;believe&nbsp;i'm&nbsp;trying&nbsp;to&nbsp;do&nbsp;anything&nbsp;fancy&nbsp;on&nbsp;the&nbsp;map?

Thanks,&nbsp;Chad

---

<div class="post-metadata">

**Author:** ![David](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/d/aeb1de/32.png) [@David](https://community.thinkgeo.com/u/David)\
**Post date:** [January 23, 2009, 9:30am UTC](https://community.thinkgeo.com/t/runtime-exceptions-after-upgrading-from-beta1-to-beta2/180/2 "2009-01-23T09:30:31Z")

</div>

Chad,&nbsp;  
&nbsp;&nbsp;  
&nbsp;&nbsp;&nbsp;Can&nbsp;you&nbsp;post&nbsp;a&nbsp;little&nbsp;code&nbsp;showing&nbsp;what&nbsp;you&nbsp;are&nbsp;doing?&nbsp;&nbsp;Can&nbsp;you&nbsp;check&nbsp;to&nbsp;see&nbsp;if&nbsp;this&nbsp;is&nbsp;happening&nbsp;in&nbsp;our&nbsp;samples?&nbsp;&nbsp;Could&nbsp;you&nbsp;compare&nbsp;a&nbsp;little&nbsp;bit&nbsp;between&nbsp;them&nbsp;and&nbsp;your&nbsp;code.&nbsp;&nbsp;If&nbsp;you&nbsp;post&nbsp;a&nbsp;simple&nbsp;sample&nbsp;it&nbsp;would&nbsp;be&nbsp;tons&nbsp;easier&nbsp;to&nbsp;help&nbsp;you&nbsp;out.&nbsp;&nbsp;Sorry&nbsp;about&nbsp;the&nbsp;problems.&nbsp;  
&nbsp;&nbsp;  
&nbsp;In&nbsp;general&nbsp;this&nbsp;is&nbsp;an&nbsp;exception&nbsp;when&nbsp;you&nbsp;try&nbsp;to&nbsp;call&nbsp;a&nbsp;method&nbsp;on&nbsp;a&nbsp;GeoCanvas&nbsp;before&nbsp;you&nbsp;have&nbsp;called&nbsp;the&nbsp;BeginDraw&nbsp;on&nbsp;it.&nbsp;&nbsp;If&nbsp;you&nbsp;are&nbsp;not&nbsp;doing&nbsp;anything&nbsp;special&nbsp;you&nbsp;should&nbsp;not&nbsp;see&nbsp;this&nbsp;so&nbsp;it&nbsp;might&nbsp;be&nbsp;a&nbsp;bug.&nbsp;:-(&nbsp;  
&nbsp;&nbsp;  
&nbsp;David

---

<div class="post-metadata">

**Author:** ![charryman](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/charryman/32/25013_2.png) [@charryman](https://community.thinkgeo.com/u/charryman)\
**Post date:** [January 23, 2009, 9:34am UTC](https://community.thinkgeo.com/t/runtime-exceptions-after-upgrading-from-beta1-to-beta2/180/3 "2009-01-23T09:34:18Z")

</div>

I&nbsp;got&nbsp;restless&nbsp;and&nbsp;called&nbsp;about&nbsp;this&nbsp;but&nbsp;while&nbsp;putting&nbsp;together&nbsp;a&nbsp;small&nbsp;demo&nbsp;project&nbsp;with&nbsp;the&nbsp;problem&nbsp;i&nbsp;think&nbsp;i&nbsp;narrowed&nbsp;down&nbsp;what&nbsp;is&nbsp;causing&nbsp;the&nbsp;problem.&nbsp;&nbsp;Basically&nbsp;when&nbsp;stripping&nbsp;everything&nbsp;out&nbsp;and&nbsp;simply&nbsp;adding&nbsp;a&nbsp; **ScaleBarAdornmentLayer&nbsp;** to&nbsp;the&nbsp;map,&nbsp;I&nbsp;always&nbsp;get&nbsp;this&nbsp;exception.&nbsp;

//This&nbsp;code&nbsp;left&nbsp;in&nbsp;gives&nbsp;the&nbsp;exception,&nbsp;take&nbsp;it&nbsp;out&nbsp;and&nbsp;problem&nbsp;goes&nbsp;away.

ScaleBarAdornmentLayer

sbar.Name&nbsp;=

sbar.Location&nbsp;=

Map.StaticOverlay.Layers.Add(&nbsp;sbar.Name,&nbsp;sbar&nbsp;);

&nbsp;sbar&nbsp;=&nbsp;new&nbsp;ScaleBarAdornmentLayer();"adsf";AdornmentLocation.Center;

&nbsp;

---

<div class="post-metadata">

**Author:** ![charryman](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/charryman/32/25013_2.png) [@charryman](https://community.thinkgeo.com/u/charryman)\
**Post date:** [January 23, 2009, 9:37am UTC](https://community.thinkgeo.com/t/runtime-exceptions-after-upgrading-from-beta1-to-beta2/180/4 "2009-01-23T09:37:46Z")

</div>

FYI\>\>&nbsp;Just&nbsp;went&nbsp;into&nbsp;the&nbsp;samples&nbsp;and&nbsp;tried&nbsp;changing&nbsp;the&nbsp;boiler&nbsp;plate

example&nbsp;to&nbsp;use&nbsp;a&nbsp;ScaleBarAdornmentLayer&nbsp;instead&nbsp;of&nbsp;the&nbsp;Line...&nbsp;And&nbsp;am&nbsp;getting&nbsp;the&nbsp;same&nbsp;exception&nbsp;as&nbsp;i&nbsp;was&nbsp;getting&nbsp;in&nbsp;my&nbsp;own&nbsp;project.&nbsp;&nbsp;Should&nbsp;be&nbsp;easy&nbsp;to&nbsp;reproduce&nbsp;now.

CreateAScaleLineAdornmentLayer

---

<div class="post-metadata">

**Author:** ![David](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/d/aeb1de/32.png) [@David](https://community.thinkgeo.com/u/David)\
**Post date:** [January 23, 2009, 9:46am UTC](https://community.thinkgeo.com/t/runtime-exceptions-after-upgrading-from-beta1-to-beta2/180/5 "2009-01-23T09:46:36Z")

</div>

Chad,&nbsp;  
&nbsp;&nbsp;  
&nbsp;&nbsp;Thank&nbsp;you&nbsp;very&nbsp;much,&nbsp;that&nbsp;narrows&nbsp;it&nbsp;down&nbsp;allot!&nbsp;&nbsp;I&nbsp;will&nbsp;check&nbsp;to&nbsp;see&nbsp;with&nbsp;the&nbsp;developers&nbsp;if&nbsp;there&nbsp;is&nbsp;a&nbsp;bug&nbsp;in&nbsp;there&nbsp;somewhere.&nbsp;&nbsp;For&nbsp;now&nbsp;if&nbsp;you&nbsp;could&nbsp;leave&nbsp;it&nbsp;out&nbsp;until&nbsp;I&nbsp;get&nbsp;back&nbsp;with&nbsp;you.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Please&nbsp;post&nbsp;a&nbsp;response&nbsp;to&nbsp;this&nbsp;message.&nbsp;&nbsp;It&nbsp;will&nbsp;make&nbsp;sure&nbsp;this&nbsp;thread&nbsp;stays&nbsp;in&nbsp;our&nbsp;work&nbsp;queue&nbsp;so&nbsp;when&nbsp;I&nbsp;have&nbsp;the&nbsp;result&nbsp;I&nbsp;can&nbsp;respond.&nbsp;&nbsp;This&nbsp;just&nbsp;helps&nbsp;me&nbsp;out,&nbsp;when&nbsp;a&nbsp;thread&nbsp;ends&nbsp;with&nbsp;my&nbsp;response&nbsp;it&nbsp;is&nbsp;take&nbsp;out&nbsp;of&nbsp;the&nbsp;queue.&nbsp;  
&nbsp;&nbsp;  
&nbsp;David

---

<div class="post-metadata">

**Author:** ![charryman](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/charryman/32/25013_2.png) [@charryman](https://community.thinkgeo.com/u/charryman)\
**Post date:** [January 23, 2009, 9:55am UTC](https://community.thinkgeo.com/t/runtime-exceptions-after-upgrading-from-beta1-to-beta2/180/6 "2009-01-23T09:55:23Z")

</div>

No&nbsp;problem.&nbsp;&nbsp;Yeah&nbsp;i&nbsp;went&nbsp;ahead&nbsp;and&nbsp;switched&nbsp;over&nbsp;to&nbsp;the&nbsp; **ScaleLineAdornmentLayer&nbsp;** for&nbsp;the&nbsp;time&nbsp;being.&nbsp;&nbsp;Any&nbsp;chance&nbsp;you&nbsp;can&nbsp;get&nbsp;someone&nbsp;to&nbsp;look&nbsp;into&nbsp;my&nbsp;previous&nbsp;post&nbsp;about&nbsp;how&nbsp;to&nbsp;get&nbsp;the&nbsp;FullExtent&nbsp;of&nbsp;a&nbsp;map&nbsp;:-)

---

<div class="post-metadata">

**Author:** ![Ben](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/ben/32/25720_2.png) [@Ben](https://community.thinkgeo.com/u/Ben)\
**Post date:** [February 1, 2009, 4:14am UTC](https://community.thinkgeo.com/t/runtime-exceptions-after-upgrading-from-beta1-to-beta2/180/7 "2009-02-01T04:14:49Z")

</div>

Chad,&nbsp;  
&nbsp;&nbsp;  
&nbsp;We&nbsp;confirmed&nbsp;it&nbsp;is&nbsp;a&nbsp;bug&nbsp;and&nbsp;thanks&nbsp;for&nbsp;reporting.&nbsp;We&nbsp;have&nbsp;committed&nbsp;it&nbsp;to&nbsp;our&nbsp;issue&nbsp;system&nbsp;and&nbsp;we&nbsp;will&nbsp;fix&nbsp;it&nbsp;in&nbsp;the&nbsp;next&nbsp;release.&nbsp;&nbsp;  
&nbsp;&nbsp;  
&nbsp;Thanks,&nbsp;  
&nbsp;&nbsp;  
&nbsp;Ben.
