Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Exceptionless/EventBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ public EventBuilder AddTags(params string[] tags) {

/// <summary>
/// Sets an extended property value to include with the event. Use either <paramref name="excludedPropertyNames" /> or
/// <see cref="Exceptionless.Json.ExceptionlessIgnoreAttribute" /> to exclude data from being included in the event report.
/// <see cref="System.Text.Json.Serialization.JsonIgnoreAttribute" /> to exclude data from being included in the event report.
/// </summary>
/// <param name="name">The name of the object to add.</param>
/// <param name="value">The data object to add.</param>
Expand All @@ -131,7 +131,7 @@ public EventBuilder SetProperty(string name, object value, int? maxDepth = null,

/// <summary>
/// Adds the object to extended data. Use either <paramref name="excludedPropertyNames" /> or
/// <see cref="Exceptionless.Json.ExceptionlessIgnoreAttribute" /> to exclude data from being included in the event.
/// <see cref="System.Text.Json.Serialization.JsonIgnoreAttribute" /> to exclude data from being included in the event.
/// </summary>
/// <param name="data">The data object to add.</param>
/// <param name="name">The name of the object to add.</param>
Expand Down
15 changes: 1 addition & 14 deletions src/Exceptionless/Exceptionless.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -23,30 +23,17 @@
<None Include="readme.txt" pack="true" PackagePath="." />
</ItemGroup>

<ItemGroup Label="Build">
<EmbeddedResource Include="Newtonsoft.Json\Dynamic.snk">
<Link>Exceptionless.Json.Dynamic.snk</Link>
</EmbeddedResource>
</ItemGroup>

<PropertyGroup Condition="'$(TargetFramework)' == 'netstandard2.0'" Label="Build">
<DefineConstants>$(DefineConstants);NETSTANDARD;NETSTANDARD2_0;HAVE_ADO_NET;HAVE_APP_DOMAIN;HAVE_ASYNC;HAVE_BIG_INTEGER;HAVE_BINARY_FORMATTER;HAVE_BINARY_SERIALIZATION;HAVE_BINARY_EXCEPTION_SERIALIZATION;HAVE_CHAR_TO_LOWER_WITH_CULTURE;HAVE_CHAR_TO_STRING_WITH_CULTURE;HAVE_COM_ATTRIBUTES;HAVE_COMPONENT_MODEL;HAVE_CONCURRENT_COLLECTIONS;HAVE_COVARIANT_GENERICS;HAVE_DATA_CONTRACTS;HAVE_DATE_TIME_OFFSET;HAVE_DB_NULL_TYPE_CODE;HAVE_DYNAMIC;HAVE_EMPTY_TYPES;HAVE_ENTITY_FRAMEWORK;HAVE_EXPRESSIONS;HAVE_FAST_REVERSE;HAVE_FSHARP_TYPES;HAVE_FULL_REFLECTION;HAVE_GUID_TRY_PARSE;HAVE_HASH_SET;HAVE_ICLONEABLE;HAVE_ICONVERTIBLE;HAVE_IGNORE_DATA_MEMBER_ATTRIBUTE;HAVE_INOTIFY_COLLECTION_CHANGED;HAVE_INOTIFY_PROPERTY_CHANGING;HAVE_ISET;HAVE_LINQ;HAVE_MEMORY_BARRIER;HAVE_METHOD_IMPL_ATTRIBUTE;HAVE_NON_SERIALIZED_ATTRIBUTE;HAVE_READ_ONLY_COLLECTIONS;HAVE_SECURITY_SAFE_CRITICAL_ATTRIBUTE;HAVE_SERIALIZATION_BINDER_BIND_TO_NAME;HAVE_STREAM_READER_WRITER_CLOSE;HAVE_STRING_JOIN_WITH_ENUMERABLE;HAVE_TIME_SPAN_PARSE_WITH_CULTURE;HAVE_TIME_SPAN_TO_STRING_WITH_CULTURE;HAVE_TIME_ZONE_INFO;HAVE_TRACE_WRITER;HAVE_TYPE_DESCRIPTOR;HAVE_UNICODE_SURROGATE_DETECTION;HAVE_VARIANT_TYPE_PARAMETERS;HAVE_VERSION_TRY_PARSE;HAVE_XLINQ;HAVE_XML_DOCUMENT;HAVE_XML_DOCUMENT_TYPE;HAVE_CONCURRENT_DICTIONARY;</DefineConstants>
</PropertyGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'" Label="Package References">
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="10.0.5" />
<PackageReference Include="System.Reflection.Emit.Lightweight" Version="4.7.0" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="System.Reflection.Metadata" Version="10.0.5" />
<PackageReference Include="System.Text.Json" Version="10.0.0" />
<PackageReference Include="System.Threading.Tasks.Extensions" Version="4.6.3" />
</ItemGroup>

<PropertyGroup Condition="'$(TargetFramework)' == 'net462'" Label="Build">
<DefineConstants>$(DefineConstants);NET45;HAVE_ADO_NET;HAVE_APP_DOMAIN;HAVE_ASYNC;HAVE_BIG_INTEGER;HAVE_BINARY_FORMATTER;HAVE_BINARY_SERIALIZATION;HAVE_BINARY_EXCEPTION_SERIALIZATION;HAVE_CAS;HAVE_CHAR_TO_LOWER_WITH_CULTURE;HAVE_CHAR_TO_STRING_WITH_CULTURE;HAVE_COM_ATTRIBUTES;HAVE_COMPONENT_MODEL;HAVE_CONCURRENT_COLLECTIONS;HAVE_COVARIANT_GENERICS;HAVE_DATA_CONTRACTS;HAVE_DATE_TIME_OFFSET;HAVE_DB_NULL_TYPE_CODE;HAVE_DYNAMIC;HAVE_EMPTY_TYPES;HAVE_ENTITY_FRAMEWORK;HAVE_EXPRESSIONS;HAVE_FAST_REVERSE;HAVE_FSHARP_TYPES;HAVE_FULL_REFLECTION;HAVE_GUID_TRY_PARSE;HAVE_HASH_SET;HAVE_ICLONEABLE;HAVE_ICONVERTIBLE;HAVE_IGNORE_DATA_MEMBER_ATTRIBUTE;HAVE_INOTIFY_COLLECTION_CHANGED;HAVE_INOTIFY_PROPERTY_CHANGING;HAVE_ISET;HAVE_LINQ;HAVE_MEMORY_BARRIER;HAVE_METHOD_IMPL_ATTRIBUTE;HAVE_NON_SERIALIZED_ATTRIBUTE;HAVE_READ_ONLY_COLLECTIONS;HAVE_REFLECTION_EMIT;HAVE_SECURITY_SAFE_CRITICAL_ATTRIBUTE;HAVE_SERIALIZATION_BINDER_BIND_TO_NAME;HAVE_STREAM_READER_WRITER_CLOSE;HAVE_STRING_JOIN_WITH_ENUMERABLE;HAVE_TIME_SPAN_PARSE_WITH_CULTURE;HAVE_TIME_SPAN_TO_STRING_WITH_CULTURE;HAVE_TIME_ZONE_INFO;HAVE_TRACE_WRITER;HAVE_TYPE_DESCRIPTOR;HAVE_UNICODE_SURROGATE_DETECTION;HAVE_VARIANT_TYPE_PARAMETERS;HAVE_VERSION_TRY_PARSE;HAVE_XLINQ;HAVE_XML_DOCUMENT;HAVE_XML_DOCUMENT_TYPE;HAVE_CONCURRENT_DICTIONARY;</DefineConstants>
</PropertyGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net462'" Label="Framework References">
<Reference Include="Microsoft.VisualBasic" />
<Reference Include="System.Configuration" />
Expand Down
5 changes: 4 additions & 1 deletion src/Exceptionless/Extensions/DataDictionaryExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,10 @@ public static void AddObject(this IData data, ExtendedDataInfo info, Exceptionle
if (String.IsNullOrEmpty(json))
return;

data.Data[name] = json;
if (dataType.IsPrimitiveType())
data.Data[name] = json;
else
data.Data.SetRawJson(name, json);
}
}
}
4 changes: 2 additions & 2 deletions src/Exceptionless/Models/Client/ClientConfiguration.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
namespace Exceptionless.Models {
[Json.JsonObject(NamingStrategyType = typeof(Json.Serialization.SnakeCaseNamingStrategy))]

public class ClientConfiguration {
public ClientConfiguration() {
Settings = new SettingsDictionary();
}

public int Version { get; set; }
public SettingsDictionary Settings { get; private set; }
public SettingsDictionary Settings { get; set; }

public void IncrementVersion() {
Version++;
Expand Down
7 changes: 4 additions & 3 deletions src/Exceptionless/Models/Client/Data/EnvironmentInfo.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System.Text.Json.Serialization;

namespace Exceptionless.Models.Data {
[Json.JsonObject(NamingStrategyType = typeof(Json.Serialization.SnakeCaseNamingStrategy))]
public class EnvironmentInfo : IData {
public EnvironmentInfo() {
Data = new DataDictionary();
Expand Down Expand Up @@ -67,13 +68,13 @@ public EnvironmentInfo() {
/// <summary>
/// The OS name that the error occurred on.
/// </summary>
[Json.JsonProperty("o_s_name")]
[JsonPropertyName("o_s_name")]
public string OSName { get; set; }

/// <summary>
/// The OS version that the error occurred on.
/// </summary>
[Json.JsonProperty("o_s_version")]
[JsonPropertyName("o_s_version")]
public string OSVersion { get; set; }

/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion src/Exceptionless/Models/Client/Data/Error.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
namespace Exceptionless.Models.Data {
[Json.JsonObject(NamingStrategyType = typeof(Json.Serialization.SnakeCaseNamingStrategy))]

public class Error : InnerError {
public Error() {
Modules = new ModuleCollection();
Expand Down
2 changes: 1 addition & 1 deletion src/Exceptionless/Models/Client/Data/InnerError.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
namespace Exceptionless.Models.Data {
[Json.JsonObject(NamingStrategyType = typeof(Json.Serialization.SnakeCaseNamingStrategy))]

public class InnerError : IData {
public InnerError() {
Data = new DataDictionary();
Expand Down
2 changes: 1 addition & 1 deletion src/Exceptionless/Models/Client/Data/ManualStackingInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using Exceptionless.Extensions;

namespace Exceptionless.Models.Data {
[Json.JsonObject(NamingStrategyType = typeof(Json.Serialization.SnakeCaseNamingStrategy))]

public class ManualStackingInfo {
public ManualStackingInfo() {
SignatureData = new Dictionary<string, string>();
Expand Down
2 changes: 1 addition & 1 deletion src/Exceptionless/Models/Client/Data/Method.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using System.Collections.Generic;

namespace Exceptionless.Models.Data {
[Json.JsonObject(NamingStrategyType = typeof(Json.Serialization.SnakeCaseNamingStrategy))]

public class Method : IData {
public Method() {
Data = new DataDictionary();
Expand Down
2 changes: 1 addition & 1 deletion src/Exceptionless/Models/Client/Data/Module.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using System.Text;

namespace Exceptionless.Models.Data {
[Json.JsonObject(NamingStrategyType = typeof(Json.Serialization.SnakeCaseNamingStrategy))]

public class Module : IData {
public Module() {
Data = new DataDictionary();
Expand Down
2 changes: 1 addition & 1 deletion src/Exceptionless/Models/Client/Data/Parameter.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
namespace Exceptionless.Models.Data {
[Json.JsonObject(NamingStrategyType = typeof(Json.Serialization.SnakeCaseNamingStrategy))]

public class Parameter : IData {
public Parameter() {
Data = new DataDictionary();
Expand Down
5 changes: 4 additions & 1 deletion src/Exceptionless/Models/Client/Data/RequestInfo.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
using System;
using System.Collections.Generic;
using System.Text.Json.Serialization;
using Exceptionless.Serializer;

namespace Exceptionless.Models.Data {
[Json.JsonObject(NamingStrategyType = typeof(Json.Serialization.SnakeCaseNamingStrategy))]

public class RequestInfo : IData {
public RequestInfo() {
Data = new DataDictionary();
Expand Down Expand Up @@ -64,6 +66,7 @@ public RequestInfo() {
/// <summary>
/// The data that was POSTed for the request.
/// </summary>
[JsonConverter(typeof(PostDataConverter))]
public object PostData { get; set; }

/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion src/Exceptionless/Models/Client/Data/SimpleError.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
namespace Exceptionless.Models.Data {
[Json.JsonObject(NamingStrategyType = typeof(Json.Serialization.SnakeCaseNamingStrategy))]

public class SimpleError : SimpleInnerError {
public SimpleError() {
Modules = new ModuleCollection();
Expand Down
2 changes: 1 addition & 1 deletion src/Exceptionless/Models/Client/Data/SimpleInnerError.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
namespace Exceptionless.Models.Data {
[Json.JsonObject(NamingStrategyType = typeof(Json.Serialization.SnakeCaseNamingStrategy))]

public class SimpleInnerError : IData {
public SimpleInnerError() {
Data = new DataDictionary();
Expand Down
2 changes: 1 addition & 1 deletion src/Exceptionless/Models/Client/Data/StackFrame.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
namespace Exceptionless.Models.Data {
[Json.JsonObject(NamingStrategyType = typeof(Json.Serialization.SnakeCaseNamingStrategy))]

public class StackFrame : Method {
public string FileName { get; set; }
public int LineNumber { get; set; }
Expand Down
2 changes: 1 addition & 1 deletion src/Exceptionless/Models/Client/Data/UserDescription.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System;

namespace Exceptionless.Models.Data {
[Json.JsonObject(NamingStrategyType = typeof(Json.Serialization.SnakeCaseNamingStrategy))]

public class UserDescription : IData {
public UserDescription() {
Data = new DataDictionary();
Expand Down
2 changes: 1 addition & 1 deletion src/Exceptionless/Models/Client/Data/UserInfo.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System;

namespace Exceptionless.Models.Data {
[Json.JsonObject(NamingStrategyType = typeof(Json.Serialization.SnakeCaseNamingStrategy))]

public class UserInfo : IData {
public UserInfo() {
Data = new DataDictionary();
Expand Down
2 changes: 1 addition & 1 deletion src/Exceptionless/Models/Client/Event.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using System.Collections.Generic;

namespace Exceptionless.Models {
[Json.JsonObject(NamingStrategyType = typeof(Json.Serialization.SnakeCaseNamingStrategy))]

public class Event : IData {
public Event() {
Tags = new TagSet();
Expand Down
41 changes: 41 additions & 0 deletions src/Exceptionless/Models/Collections/DataDictionary.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,38 @@

namespace Exceptionless.Models {
public class DataDictionary : Dictionary<string, object> {
private readonly HashSet<string> _rawJsonKeys = new HashSet<string>(StringComparer.OrdinalIgnoreCase);

public DataDictionary() : base(StringComparer.OrdinalIgnoreCase) {}

public DataDictionary(IEnumerable<KeyValuePair<string, object>> values) : base(StringComparer.OrdinalIgnoreCase) {
foreach (var kvp in values)
Add(kvp.Key, kvp.Value);
}

public new object this[string key] {
get => base[key];
set {
ClearRawJson(key);
base[key] = value;
}
}

public new void Add(string key, object value) {
ClearRawJson(key);
base.Add(key, value);
}

public new bool Remove(string key) {
ClearRawJson(key);
return base.Remove(key);
}

public new void Clear() {
_rawJsonKeys.Clear();
base.Clear();
}

public object GetValueOrDefault(string key) {
return TryGetValue(key, out object value) ? value : null;
}
Expand All @@ -35,5 +60,21 @@ public string GetString(string name, string @default) {

return String.Empty;
}

internal bool IsRawJson(string key) {
return !String.IsNullOrEmpty(key) && _rawJsonKeys.Contains(key);
}

internal void SetRawJson(string key, string value) {
base[key] = value;

if (!String.IsNullOrEmpty(key))
_rawJsonKeys.Add(key);
}

private void ClearRawJson(string key) {
if (!String.IsNullOrEmpty(key))
_rawJsonKeys.Remove(key);
}
}
}
46 changes: 0 additions & 46 deletions src/Exceptionless/Newtonsoft.Json/Bson/BsonBinaryType.cs

This file was deleted.

Loading
Loading