Upgrade ScriptSharp from 0.7.4 to 0.7.6 throws "getField is not defined" errors

StackOverflow https://stackoverflow.com/questions/14328534

  •  15-01-2022
  •  | 
  •  

Question

I just compiled the master branch of ScriptSharp on my machine and upgraded the dlls (mscorlib, Script.jQuery, Script.jQuery.History, Script.Web) and javascript (mscorlib.js) files of my project.

I had to change a lot of Type.GetField, Type.SetField and Type.InvokeMethod calls to use them in the Script class because they were moved there in 0.7.6. Then my project compiled successfully.

Now, when I load my project in the browser, I have this getField is not defined error. I tested on Windows 7 in Chrome and Internet Explorer 10 and got the same error in both. I also checked that the mscorlib.js file my browser is using is the 0.7.6 one.

Did I miss something? Where this getField method is supposed to be declared? I don't see it in mscorlib.js.

Thank you

Jeff

Was it helpful?

Solution

Did you also update the compiler from your private build? Specifically the ScriptSharp.dll and ScriptSharp.Build assemblies. As well as the msbuild .targets file that matches those.

The new compiler that goes hand-in-hand should also convert Script.GetField into the desired script, rather than a call to a non-existant getField method.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top