6

I am new in computer science (so hopefully I am using the right words and give the right information to answer this question), hopefully you guys can help me. I want to automatically transfer (JSON) data between two .NET Solutions.

I have two Solutions in .NET:

  1. The Bot Framework SDK - Build in .NET Core 2.2 (https://learn.microsoft.com/en-us/azure/bot-service/dotnet/bot-builder-dotnet-sdk-quickstart?view=azure-bot-service-4.0)

    • From what I understand: build in ASP.NET Core
  2. The Qlik Sense .Net SDK. - build in .NET Framework 4.5.2 (https://github.com/kolsrud/qlik-dot-net-sdk-hypercube-usage)

I want to let these two solutions communicate with each other.

  • On the one hand: in the QlikSense.NET SDK we store all the data into a variable (let's say variable 'Sales', holding JSON data), if this variable is updated, I want to transfer it to the Bot framework (and store the data here).

  • On the other hand: we have a variable in the Bot Framework (let's say variable 'Query', holding JSON data), if that variable is updated, I want to pass it to the Qliksense SDK.

Summarized: I want to automatically transfer (JSON) data between the Qliksense SDK and the Bot framework SDK. How can I do that?

Again, sorry if something is unclear. Thanks in advance for you help! Appreciated!

Edit 1: What have I tried? As asked by Selvin:
The only thing that I could come up with, was writing the JSON variable into a text file, and read that Text file from the other script. But, I don't think that this is a proper 'solution'.

6
  • -1 for repost same question ... stackoverflow.com/questions/55218740/… 2h ago Commented Mar 18, 2019 at 12:11
  • I deleted that post 90 minutes before I posted this post (I deleted it directly after the first comment). to give more clarity in this post (as I had the assumption that Scripts was the right word). Commented Mar 18, 2019 at 12:14
  • It's still too broad ... you didn't wrote what had you tried so far and where did you failed. ... also there is no question in your "question" Commented Mar 18, 2019 at 12:15
  • 1
    Hi, your question is quite broad but I wondered why you'd decided that using a file wasn't right? If it works don't knock it. Generally with shared information you have to make someone or something the gatekeeper for that information and a file might be the answer in your case (just be sure to use file locking to serialize writes.) Is using a file too slow? You think you should be using the network? But if you do that who owns the data? Have you considered a small Redis server? (See redis.io). Regards, Adam. Commented Mar 18, 2019 at 12:38
  • 1
    Thanks Adam. To be sure, Is your solution then: .Net Framework <-> Redis Server <-> .NET Core? Commented Mar 19, 2019 at 12:18

3 Answers 3

5
+50

There are a few solutions, which you can apply depending on details in your projects.

As I understand you are using Bot framework SDK without anything more. The base Nuget is written in .NET Standard 2.0, which can be used both in dotNet Core and dotNet Framework. So the easiest way is to upgrade/change your project to compile on dotNet Framework instead of dotNet Core. Then you can reference the second project without any problems.

If there are more compilations which I don't know you can do one of the following solutions:

  1. Create to processes on the same machine a send "messages" between them (one is a file as you mentioned, second is HTTP requests, third are queues, and more ...) - I can provide more details if I know how you want to host your solution
  2. Try to migrate QlikSense project to dotNet Core. You can check if migration is easy using the official guide: https://learn.microsoft.com/en-us/dotnet/core/porting/third-party-deps and this post: https://www.stevejgordon.co.uk/migrating-full-net-framework-net-core
  3. Search another library for QlikSense if you want to stay with dotnet Core
Sign up to request clarification or add additional context in comments.

Comments

3

Disclaimer

This answer assumes ( as I can not discern any such details from the question ) that you already have your applications communicating, and are able to serialize and deserialize JSON and what you desire assistance with is the automatic sending of data on object update.

Use encapsulation to handle updates

By using c#'s class mechanisms, you can - make sure your "Sales" variable is only updated via your publicly displayed update method - the publicly displayed update method also sends the new data to your other application

class SalesContainer
{
    private string _sales;

    public string getSales()
    {
        return _sales;
    }

    public string updateSales (string sales)
    {
        _sales = sales;
        sendData(sales);
    }

    private sendData(string json)
    {
        // your sending logic here
    }
}

Alternatively, you can look a bit into operator overload to allow you to makes less changes on your existing codebase.

Comments

1

I understand you have two applications. They cann't communicate with each other directly. You need a third-party mediation. A file, database, network stream, or MemoryMappedFile. QlikSense.NET application push update to mediation, and Bot Framework application read the update from mediation.

I think this is cross-process communication problemn, so each cross-process communication solution is feasible.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.