425 questions
0
votes
0
answers
31
views
Does JavaScriptSerializer's MaxJsonLength limit apply to string content within objects or just JSON structure?
//1st way
public string GetSomeData()
{
List<SomeObject> largeCollection = GetLargeDataCollection();
JavaScriptSerializer serializer = new JavaScriptSerializer();
json = ...
0
votes
0
answers
26
views
Getting values out of the JSON with JavaScriptSerializer().DeserializeObject
I have this piece of code to extract the values form JSON. It works when parsing strings, but it has issues with the numbers. For example I always receive value (Approved or 0.1) when getting the &...
0
votes
1
answer
438
views
How to verify if an RCE-attack using JSON and the JavascriptSerializer with SimpleTypeResolver actually works in .Net Framework 4.8
When attempting to recreate an RCE attack using the unsafe configuration of JavaScriptSerializer with the SimpleTypeResolver I am not seeing any actual effect of my supposed malicious payload. I've ...
0
votes
1
answer
74
views
JavaScriptSerializer fails to serialise an object with a property inheriting from List<T>
Consider the following code (.NET Framework 4.8 c#)
using System;
using System.Collections.Generic;
using System.Web.Script.Serialization;
namespace SerialisationTest
{
class Program
{
...
0
votes
1
answer
849
views
Datatable to json - c#
I have a data table like below
Subject
Question
Qtype
English
xxxxxxx
Subjective
English
yyyyyyy
Subjective
English
zzzzzzz
Objective
English
sasasas
Objective
English
cvcvcvv
Subjective
Question ...
1
vote
0
answers
377
views
C# .NET JavaScriptSerializer - Deserializing Response that contains a String or a String Array?
I have an SSIS C# script component that hits an API, pulls down the response, and I'm working on deserializing it into a proper C# object.
Here's the basic JSON that the API returns:
{
"id&...
0
votes
1
answer
864
views
Deserialize multilevel JSON string with vb.net
I have been trying to deserialize json string in vb.net. I am able successfully get a response using
Using myResp = TryCast(myReq.GetResponse(), System.Net.HttpWebResponse)
...
0
votes
0
answers
48
views
Issue with transforming datatable to well formatted JSON string
The problem boils down to as below:
enter image description here
PS: The datatable structure is defined as above in the image.
I am using C# core to solve the problem of removing the '[' and ']' from ...
0
votes
1
answer
58
views
Access Data in Dictionary with deserialized data
My program accesses data through a Web API and gets data in JSON format. Response is for example:
{
"response":{
"stationId":"24026900",
"prices"...
0
votes
2
answers
1k
views
Parse json from web request response
Im trying to parse a http web response into an array or something so i can work with the information. This is the json response i get (+ a lot more, but i just censored the format):
{
"meta&...
0
votes
0
answers
633
views
maxJsonLength error when serializing data in .net 2.0
I am getting the following error when serializing data in asp.net 2.0. Large data is being sent from the database but it is less than the max limit because it works in .Net 4.5 when setting the ...
-1
votes
1
answer
155
views
Deserialize json string using JavaScriptSerializer
I am working on deserialize json string using JavaScriptSerializer in C#, and trying to parse the json string and map it to the appropriate columns in the sql server table for inserting data. I have ...
0
votes
1
answer
62
views
Serialize only the collection of the class
I have a following class.
class Timesheet
{
public int ID { get; set; }
public List<Employee> Approvers { get; set; }
public Employee Resource { get; set; }
...
1
vote
1
answer
873
views
Error System.MissingMethodException: No parameterless constructor defined for type of 'System.Linq.Expressions.Expression`1
I want to create dynamic expressions for my web services to allow client applications to pass dynamic queries to filter the data as they require. To this end I'm trying to serialize / deserialize an ...
0
votes
1
answer
433
views
deserialize nested json data c#
I am using javascriptserializer to deserialize json data. I am stuck on how to parse this data and assign the value to a variable.
json:
{
"data1": {
"EntityList": "Attribute",
"KeyName": "...
0
votes
2
answers
823
views
c# using JavaScriptSerializer serializer in while loop and returning to client side to Json.Parse. Getting a error
Could anyone give me a step to solve this error in getting a output. New to coding.
Step 1:
Using Json/Javascript calling a method which is in .cs file(c#)
var markers = JSON.parse('<%=...
0
votes
2
answers
685
views
How to serialize/deserialize List<Tuple<long, string, int>> using JavaScriptSerializer
I have serialized a List<Tuple<long, string, int>> obj using JavaScriptSerializer.
JavaScriptSerializer js = new JavaScriptSerializer();
return js.Serialize(dataToSerialize as IEnumerable)...
0
votes
1
answer
224
views
No parameterless constructor defined for an imported object type to be deserialized from JSON
Dim result = New JavaScriptSerializer().Deserialize(Of SearchResult)(Request.Cookies.Get("user").Value)
An exception of type 'System.MissingMethodException' occurred in System.Web.Extensions....
1
vote
1
answer
216
views
Filling a TextBox from JSON using JavaScriptSerializer
I am trying to use the JavaScriptSerializer to pull some information from a website API. However, I am new to this in vb.net and can't seem to get the textbox to load. I think it has to do with the ...
1
vote
1
answer
5k
views
How to deserialize JSON with spaces in the attribute names?
I have a string array that I want to deserialize. Essentially, it is just a list of objects. Note that the attributes have spaces in the names:
[ { \"Event Name\": \"Hurricane Irma PR\", ...
0
votes
1
answer
611
views
Using JavaScriptSerializer to Deserialize JSON C# - type not supported for deserialization of an array
New to C# and JSON but basically I have to use a C# script component in SSIS to extract data from a web service. I was able to do it initially with a different JSON format but this one includes an ...
0
votes
1
answer
135
views
JavaScriptSerializer with named tuples
If I use JavaScriptSerializer with named tuples I get following:
var serialized = new JavaScriptSerializer().Serialize((Foo: "Fooo", Bar: "Bar"));
serialized is:
{"Item1":"F","Item2":"B"}
Any ...
0
votes
2
answers
65
views
How to override the SerializeDateTime method of c# javascriptserializer class?
SerializeDateTime method returns datetime in milliseconds. I want him to turn to microseconds. SerializeDateTime method as follows:
private static void SerializeDateTime(DateTime datetime, ...
0
votes
1
answer
194
views
How to reference an assembly within the context of an ASP.NET web application
I am facing a pretty harsh issue with my ASP.NET web app, I am using visual studio community 2017, target framework .NET core 2.2.
I have to parse a JSON string and found that the System.Web.Script....
1
vote
1
answer
242
views
C# JavaScriptSerializer serialize fields that not exists in interface but do exists in original object
I'm trying to serialize an object without some fields.
I've tried to define interface without those fields, and then cast and serialize it but the JavaScriptSerializer includes those fields as well.
...