CODECUBE VENTURES

Script# Patch

So I've been using Script# for a project, and it's been going pretty well. There are a few gotchas here and there, but as long as you remember that at the end of the day it's javascript that you're coding ... you'll do fine.

We unfortunately recently came across a pretty show stopping bug in Script#'s RestRpc API. The problem was spaces were being stripped from the string properties of JSON objects that we passed to the server.

I submitted a bug on the matter, but judging from the dearth of activity on the project recently, I doubt help is coming soon.

.NET Reflector to the Rescue!!!

I won't distribute the patched assemblies, but I disassembled the nStuff.ScriptSharp.Web assembly and fixed the bug :-) The fix is included below in case anyone wants to venture into reflector-land and apply the patch themselves. Alternatively, it's simple enough that hopefully Nikhil will take notice and simply patch the library himself.

The fix is really simple, it involves making just two changes ... 1. Add the following method to the nStuff.ScriptSharp.Web.Serialization.JsonReader class:

private char GetNextSignificantStringCharacter()

{

char c = (char)this._reader.Read();

return c;

}

  1. replace the call to this.GetNextSignificantCharacter() in the ReadString method of the same class, with this.GetNextSignificantStringCharacter()

and Voila ... it's fixed.

Hope this helps someone out there :-)

Latest post: Digging Up the First Version of CodeCube

See more in the archives