# eInvalidInput error calling SetSystemVariable during Initialize()

**URL:** <https://forum.techsoft3d.com/t/einvalidinput-error-calling-setsystemvariable-during-initialize/1829>\
**Category:** AutoCAD OEM\
**Tags:** code\
**Created:** [April 6, 2023, 7:16pm UTC](https://forum.techsoft3d.com/t/einvalidinput-error-calling-setsystemvariable-during-initialize/1829 "2023-04-06T19:16:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![marc.seguin](https://avatars.discourse-cdn.com/v4/letter/m/22d042/32.png) [@marc.seguin](https://forum.techsoft3d.com/u/marc.seguin)\
**Post date:** [April 6, 2023, 7:16pm UTC](https://forum.techsoft3d.com/t/einvalidinput-error-calling-setsystemvariable-during-initialize/1829/1 "2023-04-06T19:16:11Z")

</div>

I have a component, which runs on startup of our AutoCAD OEM product, that has the following line of code in the Initialize method. This line of code is throwing an eInvalidInput exception.

```
 Application.SetSystemVariable("DYNMODE", 3);

```

I can put this line of code in a different method that I call after our application is loaded and I don’t get any errors, so it just seems to happen if it’s in the Initialize method.

I tested the same component with a standalone version of AutoCAD and the component loads on startup without any issue.

Has anyone run into this, or something similar?

---

<div class="post-metadata">

**Author:** ![marc.seguin](https://avatars.discourse-cdn.com/v4/letter/m/22d042/32.png) [@marc.seguin](https://forum.techsoft3d.com/u/marc.seguin)\
**Post date:** [June 16, 2023, 7:04pm UTC](https://forum.techsoft3d.com/t/einvalidinput-error-calling-setsystemvariable-during-initialize/1829/2 "2023-06-16T19:04:09Z")

</div>

This error seemed to go away after a full new build of all of our assemblies and creating a new build with the Make Wizzard

---

<div class="post-metadata">

**Author:** ![shawn.g](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.techsoft3d.com/shawn.g/32/482_2.png) [@shawn.g](https://forum.techsoft3d.com/u/shawn.g)\
**Post date:** [June 16, 2023, 8:49pm UTC](https://forum.techsoft3d.com/t/einvalidinput-error-calling-setsystemvariable-during-initialize/1829/3 "2023-06-16T20:49:47Z")

</div>

Yeah, using the Make Wizard each time is the way to go. We experienced far less issues after automating it to run each time we build an Installer and Update.
