Issues after upgrading from ServiceStack 4.5.14 to 6.9

Below is the github link for my App

Below is the github link for my ConsoleApp

Please review my projects and let me know if you have any further questions.
Please run the testField App and then run the TFConsoleApp to replicate the issue of FieldDictionary that we are facing
Please suggest if there are any modifications to be made

Found this below blog that talks about the exact same issue I am facing
Issue with FieldDictionary data type not returning values in GET request (ServiceStack version 6.9) (trycatchdebug.net)

Nothing’s changed, you’re still trying to do everything I’ve said to avoid doing in my previous answer, i.e. you’re creating a custom Dictionary and you’re using interfaces in types:

[CollectionDataContract(Name = "Field", ItemName = "Field")]
[SDKObjectAttribute]
public partial class FieldDictionary : Dictionary<string, ITProperty>
{
}

Don’t. Get rid of the whole concept of FieldDictionary and all other Custom Types that tries to inherit a Dictionary.

Use dictionaries with concrete types instead:

public class Dto
{
    public Dictionary<string,string> StringDictionary { get; set; }
    public Dictionary<string,Poco> PocoDictionary { get; set; }
}

If you absolutely need to, you can use an object dictionary:

public class Dto
{
    public Dictionary<string,object> ObjectDictionary { get; set; }
}

But this has all the issues of using object and interfaces in DTOs, i.e. it wont work in non .NET Add ServiceStack Reference languages.

I have got rid of inheritance like you told but still response.Fields.StringDictionary is null on running my console app
Below is my modified project and the console app
Please run the app “testField.sln” and the console app “TFConsoleApp.sln” to replicate the issue.
You can find my modfications that you had mentioned to change in the below 2 files

Below mentioned are the modified projects.
sahanar28/ApptestField__2 (github.com)

sahanar28/TFConsoleApp_2 (github.com)

Will be awaiting for your suggestions. Thank you

What JSON payload are you trying to deserialize and into what C# DTO?

JSON payload i am trying to deserialize is the ‘HelloResponse’ object i.e the ‘Fields’ property of type ‘Dto’ class, which contains a dictionary of string key-value pair.
In my Dto class i have added a ‘StringDictionary’ property

    public class Dto
    {
        public Dictionary<string, string> StringDictionary { get; set; }
    }

In the Get method of my service, I have a HelloResponse object and its Fields property with a new instance of the Dto class. Inside the Dto class, I have initialized the StringDictionary property with some predefined key-value pairs for demonstration purpose.

Below is the code

public object Get(Hello request)
        {
            var response = new HelloResponse
            {
                Fields = new Dto
                {
                    StringDictionary = new Dictionary<string, string>
            {
                { "Key1", "value1" },
                { "Key2", "value2" }
            }
                }
            };

            return response;
        }

Note sure what issue I’m meant to be looking at, the GitHub - sahanar28/TFConsoleApp_2 project doesn’t compile, but I’ve copied/pasted the sample source code into a test project in ApptestField, had to fix the Base URL, but otherwise runs without issue:

[Test]
public void Test_Hello_Api()
{
    // Should only contain the **BaseUrl** of the ServiceStack Server
    var client = new JsonServiceClient("https://localhost:5001"); 

    ServicePointManager.ServerCertificateValidationCallback += (_, _, _, _) => true;

    Hello request = new Hello() { Name = "World" };

    HelloResponse response = client.Get<HelloResponse>(request);

    if (response != null)
    {
        response.Fields.PrintDump();
        var fields = response.Fields;
    }
    else
    {
        Console.WriteLine("No response received.");
    }
}

Output:

{
	StringDictionary: 
	{
		Key1: value1,
		Key2: value2
	}
}

Yes what you have tried will work for us as well but what is not working is when we run the console app for the ApptestField__2 application by referencing the ServiceStack dlls of version 6.9 and try to retrieve the Fields property, response.Fields.StringDictionary is null

After opening my ApptestField__2 project in visual studio, In the Solution Explorer > TFConsoleApp > Dependencies > Assemblies > Can you please remove the existing Assemblies. Though i have referenced them not sure after extracting it is not loading properly
[MyApp.dll, MyApp.ServiceInterface.dll, MyApp.ServiceModel.dll, ServiceStack.dll, ServiceStack.Client.dll, ServiceStack.Common.dll, ServiceStack.Interfaces.dll, ServiceStack.Text.dll, System.Data.SQLite.dll]

So could you please add these above mentioned assemblies again from \ApptestField__2-master\ApptestField__2-master\MyApp\bin\Debug\net6.0

Compile it and run it should work now

You should not be uploading binaries to source projects or including internal references to them, replace them with Package References so they can be built and run by others.

Your issue is due to your custom configuration breaking the deserialization, you’re even suppressing the Exception that’s thrown with an empty catch block so you must already know about the issue your code is causing.