# How can I prevent a package from loading into a notebook run from Workbench?

I have a Workbench project in which I have created two packages: PackageA.m and PackageB.m. In the same project, there is a notebook called Test.nb.

When I right-click Test.nb in the navigator and select Run As -> Mathematica, I find that all of the symbols in the two packages are loaded even though I have not actually executed

(* These lines have not been executed! *)
<<"PackageA";
<<"PackageB";


For instance, when I run

(* DemoSum is a function defined in PackageA *)
DemoSum[2, 3]


I get the answer 5.

Is there a way to prevent all the packages from loading automatically when I right-click a notebook and select "Run As -> Mathematica"?

• May I ask why you would want to do that rather than simply opening your notebook outside the Workbench ? – b.gates.you.know.what Jan 23 '15 at 9:20
• @b.gatessucks It is a pretty big code base, and there is a lot of code that I would have to copy over if I were to open the notebook outside of Workbench. (But I am headed in that direction since I am refactoring everything.) – Shredderroy Jan 23 '15 at 20:32
• Thank you for your explanation. – b.gates.you.know.what Jan 23 '15 at 23:07

1. Disable automatic package loading completely, in a project, by setting "Execution Build Command" to something that doesn't load packages e.g. None.