I'm running a MVC project and utilizing Json, I have code that is running properly when running within Visual Studio, then I have a Site on IIS pointing to the same folder, when executed a URL from the IIS site my code doesn't perform the same as being in Visual Studio.
Within my code, I have:
return JsonConvert.SerializeObject(objectToSerialize);
When I send RouteData.Values, it produces this error:
Error getting value from 'CompiledAssembly' on 'System.CodeDom.Compiler.CompilerResults'.
at Newtonsoft.Json.Serialization.DynamicValueProvider.GetValue(Object target)
at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.CalculatePropertyValues(JsonWriter writer, Object value, JsonContainerContract contract, JsonProperty member, JsonProperty property, JsonContract& memberContract, Object& memberValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeObject(JsonWriter writer, Object value, JsonObjectContract contract, JsonProperty member, JsonContainerContract collectionContract, JsonProperty containerProperty)
at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeISerializable(JsonWriter writer, ISerializable value, JsonISerializableContract contract, JsonProperty member, JsonContainerContract collectionContract, JsonProperty containerProperty)
at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.Serialize(JsonWriter jsonWriter, Object value, Type objectType)
at Newtonsoft.Json.JsonSerializer.SerializeInternal(JsonWriter jsonWriter, Object value, Type objectType)
at Newtonsoft.Json.JsonConvert.SerializeObjectInternal(Object value, Type type, JsonSerializer jsonSerializer)
at Newtonsoft.Json.JsonConvert.SerializeObject(Object value)
at x.Data.Helpers.Data.JsonHelper.SerializeObject(Object objectToSerialize) in D:\Development\x\x.Data\Helpers\Data\JsonHelper.cs:line 18
I am currently using Newtonsoft.Json, Version=11.0.0.0
Any ideas what is happening? Does IIS not have something that Visual Studio does?