Skip to content
This repository has been archived by the owner on Oct 18, 2018. It is now read-only.

Booleans in JSON without a double quote throws on mono #141

Closed
Praburaj opened this issue Dec 19, 2014 · 6 comments
Closed

Booleans in JSON without a double quote throws on mono #141

Praburaj opened this issue Dec 19, 2014 · 6 comments
Assignees
Labels

Comments

@Praburaj
Copy link
Contributor

aspnet/MusicStore@e5a92da#commitcomment-9048910

warn: Invalid JSON primitive: true 
[11:19:32][Step 2/2] verbose: Stack trace: 
[11:19:32][Step 2/2]   at System.Web.Script.Serialization.JsonDeserializer.ParseBuffer (System.Object& result) [0x00000] in <filename unknown>:0 
[11:19:32][Step 2/2]   at System.Web.Script.Serialization.JsonDeserializer.ProcessCharacter (Char ch) [0x00000] in <filename unknown>:0 
[11:19:32][Step 2/2]   at System.Web.Script.Serialization.JsonDeserializer.Deserialize (System.IO.TextReader input) [0x00000] in <filename unknown>:0 
[11:19:32][Step 2/2]   at System.Web.Script.Serialization.Json.Deserialize (System.IO.TextReader input, System.Web.Script.Serialization.JavaScriptSerializer jss) [0x00000] in <filename unknown>:0 
[11:19:32][Step 2/2]   at System.Web.Script.Serialization.Json.Deserialize (System.String input, System.Web.Script.Serialization.JavaScriptSerializer jss) [0x00000] in <filename unknown>:0 
[11:19:32][Step 2/2]   at System.Web.Script.Serialization.JavaScriptSerializer.DeserializeObjectInternal (System.String input) [0x00000] in <filename unknown>:0 
[11:19:32][Step 2/2]   at System.Web.Script.Serialization.JavaScriptSerializer.DeserializeObject (System.String input) [0x00000] in <filename unknown>:0 
[11:19:32][Step 2/2]   at View7d8a15565ceb4eee902cb13633852c8a+<RenderViewLevel0>c__AnonStorey1.<>m__6 () [0x00000] in <filename unknown>:0 
[11:19:32][Step 2/2]   at Sake.Engine.Builder.BuilderBase`1[System.Object].CallTarget (System.String name) [0x00000] in <filename unknown>:0 
[11:19:32][Step 2/2]   at Sake.Engine.Builder.BuilderBase`1[System.Object].StartingTarget (System.String name) [0x00000] in <filename unknown>:0 
[11:19:32][Step 2/2]   at View7d8a15565ceb4eee902cb13633852c8a.<RenderViewLevel0>m__A () [0x00000] in <filename unknown>:0 
[11:19:32][Step 2/2]   at Sake.Engine.Builder.BuilderBase`1[System.Object].CallTarget (System.String name) [0x00000] in <filename unknown>:0 
[11:19:32][Step 2/2]   at View7d8a15565ceb4eee902cb13633852c8a.<RenderViewLevel0>m__2 () [0x00000] in <filename unknown>:0 
[11:19:32][Step 2/2]   at Sake.Engine.Builder.BuilderBase`1[System.Object].CallTarget (System.String name) [0x00000] in <filename unknown>:0 
[11:19:32][Step 2/2]   at Sake.Engine.SakeEngine.Execute (Sake.Engine.Options options) [0x00000] in <filename unknown>:0 
[11:19:32][Step 2/2]   at Sake.Engine.SakeEngine.Execute (System.String[] args) [0x00000] in <filename unknown>:0 
[11:19:32][Step 2/2]   at Sake.Program.Main (System.String[] args) [0x00000] in <filename unknown>:0 
@Praburaj Praburaj added the bug label Dec 19, 2014
@pranavkm
Copy link
Contributor

Use quotes around booleans. There's not much we could do from this script.

@Praburaj
Copy link
Contributor Author

@davidfowl

@davidfowl
Copy link
Member

We use json.net instead and hook assembly resolve to load it

@halter73
Copy link
Member

This is still issue when you try to build Kestrel on mono.

_k-test.shade uses JavaScriptSerializer, and cannot handle the true literal in the test project's project.json.

warn: Invalid JSON primitive: true

verbose: Stack trace:
  at System.Web.Script.Serialization.JsonDeserializer.ParseBuffer (System.Object& result) [0x00000] in <filename unknown>:0
  at System.Web.Script.Serialization.JsonDeserializer.ProcessCharacter (Char ch) [0x00000] in <filename unknown>:0
  at System.Web.Script.Serialization.JsonDeserializer.Deserialize (System.IO.TextReader input) [0x00000] in <filename unknown>:0
  at System.Web.Script.Serialization.Json.Deserialize (System.IO.TextReader input, System.Web.Script.Serialization.JavaScriptSerializer jss) [0x00000] in <filename unknown>:0
  at System.Web.Script.Serialization.Json.Deserialize (System.String input, System.Web.Script.Serialization.JavaScriptSerializer jss) [0x00000] in <filename unknown>:0
  at System.Web.Script.Serialization.JavaScriptSerializer.DeserializeObjectInternal (System.String input) [0x00000] in <filename unknown>:0
  at System.Web.Script.Serialization.JavaScriptSerializer.DeserializeObject (System.String input) [0x00000] in <filename unknown>:0
  at Viewbfe9a825c5d74f8bb6137c6bb089f2c9.DnxTest (System.String projectFile, Boolean testParallel) [0x00000] in <filename unknown>:0
  at Viewbfe9a825c5d74f8bb6137c6bb089f2c9+<RenderViewLevel0>c__AnonStorey1.<>m__1B (System.String projectFile) [0x00000] in <filename unknown>:0
  at System.Collections.Generic.List`1[System.String].ForEach (System.Action`1 action) [0x00000] in <filename unknown>:0
  at Viewbfe9a825c5d74f8bb6137c6bb089f2c9+<RenderViewLevel0>c__AnonStorey1.<>m__D () [0x00000] in <filename unknown>:0
  at Sake.Engine.Builder.BuilderBase`1[System.Object].CallTarget (System.String name) [0x00000] in <filename unknown>:0
  at Sake.Engine.Builder.BuilderBase`1[System.Object].StartingTarget (System.String name) [0x00000] in <filename unknown>:0
  at Viewbfe9a825c5d74f8bb6137c6bb089f2c9.<RenderViewLevel0>m__D () [0x00000] in <filename unknown>:0
  at Sake.Engine.Builder.BuilderBase`1[System.Object].CallTarget (System.String name) [0x00000] in <filename unknown>:0
  at Viewbfe9a825c5d74f8bb6137c6bb089f2c9.<RenderViewLevel0>m__5 () [0x00000] in <filename unknown>:0
  at Sake.Engine.Builder.BuilderBase`1[System.Object].CallTarget (System.String name) [0x00000] in <filename unknown>:0
  at Sake.Engine.SakeEngine.Execute (Sake.Engine.Options options) [0x00000] in <filename unknown>:0
  at Sake.Engine.SakeEngine.Execute (System.String[] args) [0x00000] in <filename unknown>:0
  at Sake.Program.Main (System.String[] args) [0x00000] in <filename unknown>:0

Quoting "true" does not resolve the issue because Dnx will not compile with the test project "/unsafe" flag like it should.

error CS0227: Unsafe code may only appear if compiling with /unsafe

@pranavkm
Copy link
Contributor

Could we switch to using the Dnx Json deserializer? Include it as source in the build scripts?

On second thoughts, that's quite a lot of code to pull in. Json.Net it is.

@pranavkm pranavkm self-assigned this Aug 14, 2015
@pranavkm
Copy link
Contributor

Working with @loudej to fix Sake to allow loading Json.Net \ other random libraries.

pranavkm added a commit that referenced this issue Sep 1, 2015
dmccaffery pushed a commit to OmniSharp/omnisharp-scaffolding that referenced this issue Nov 29, 2015
…n from the project.json file for now since the JavaScriptSerializer used by Condo cannot handle them: see aspnet/Universe#141 as an example of the same issue; will introduce a fix within condo in the very near future.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants