Database.Script Method Throwing - ArgumentOutOfRangeException
===

**Hello, I'm running the following code:**

    database.UserDefinedFunctions[name, schema].Script(dropstoredProcOptions);

With this as dropstoreProcOptions:

            ScriptingOptions dropstoreProcOptions = new ScriptingOptions();

           dropstoreProcOptions.IncludeIfNotExists = true;
            dropstoreProcOptions.ScriptDrops = true;
            dropstoreProcOptions.IncludeDatabaseContext = false;

If you run the .Script() function without any parameters no errors are thrown, however once you pass ScriptingOpstions as a parameter the following error is thrown: **ArgumentOutOfRangeException**

The same code seems to be running correctly in an old windows form application, and currently I'm porting it to a new WPF application which uses PRISM. The New WPF PRISM application is the one having the issues.

Any help or suggestions on how I could better debug it would be appreciated.
Thank you.

