Resetting a VB option in a custom script

I am writing a custom script in which I am Deserializing a response I am getting from an API call into an Object as shown by this piece of code:

Dim jss = New JavaScriptSerializer()
Dim data As Object = jss.Deserialize(Of Object)(responseFromServer)

This raises an error since the option Strict is set to On by default in all custom scripts. While working on my editor there is no issues since I can edit the option but when trying to compile the database after saving the script the error 
'BC30574 Option Strict On disallows late binding' is raised. I tried to override the option inside an the same if statement in which I import my dependencies but I get the error "option statements must precede any declarations or imports statements".

Here's the If statement I wrote at the top of my code :

#If Not SCRIPTDEBUGGER Then
Option Strict Off
Imports VI.DB.Sync
Imports VI.DB.Model
Imports System.Net
Imports System.IO
Imports Newtonsoft
Imports System.Collections.Generic
Imports System.Web.Script.Serialization
#End If

How can I modify a default option for a specific script?

Parents
  • Reset settings
    To change your development settings after you open Visual Studio for the first time, follow these steps:

    Select Tools > Import and Export Settings from the menu bar to open the Import and Export Settings Wizard.

    In the Import and Export Settings Wizard, select Reset all settings, and then select Next.

    Import and Export Settings Wizard in Visual Studio

    On the Save Current Settings page, select either Yes or No, and then select Next.

    On the Choose a Default Collection of Settings page, choose a collection, and then select Finish.

    Settings collections in Visual Studio

    On the Reset Complete page, select Close.

    Greeting,

    Rachel Gomez

Reply
  • Reset settings
    To change your development settings after you open Visual Studio for the first time, follow these steps:

    Select Tools > Import and Export Settings from the menu bar to open the Import and Export Settings Wizard.

    In the Import and Export Settings Wizard, select Reset all settings, and then select Next.

    Import and Export Settings Wizard in Visual Studio

    On the Save Current Settings page, select either Yes or No, and then select Next.

    On the Choose a Default Collection of Settings page, choose a collection, and then select Finish.

    Settings collections in Visual Studio

    On the Reset Complete page, select Close.

    Greeting,

    Rachel Gomez

Children
No Data