[ Heads Up ] Wizard Generated Code NullReference

I had some special Disposable code in the DestroyCustomCode() method under

// Begin Custom Code Disposal

After I eventually ate up all my RAM I started digging. If you use the Epicor Wizard’s they MAY sometimes null an object beforehand which will stop the rest of the code from executing. Sure GC will cleanup most of it, but not always and not everything, so be careful, just move those null’s to the bottom.

It never threw an exception, not even in VS until I actually started stepping through.

I’ve found the same behaviour in all my Customizations dating back to Epicor 9.702A

If you are doing something like this, you can expect the Sessions to remain until they timeout :wink: I guess I never paid enough attention and trusted the Wizard :smiley:

// Begin Custom Code Disposal
this.newSession.Dispose();
this.newSession = null;
// End Custom Code Disposal
4 Likes

Lesson learned… never trust a wizard.

2 Likes

Never!