-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MT4 Dotnet Core #18
Comments
Hi @maartenschalekamp, this also happens on my side, it is unrelated to mt4 or mt5. It has something to do with wcf versions >= 4.9.0. To better investigate this issue, I created the test server project for checking only the wcf communication. But recently I had no time for further analyzation, but it is on my Todo list. Sorry :( To solve it on your end, you can just use the 4.8.0 wcf dependencies, with them I Do not face this issue and all is working as expected. |
Maybe some additional background. The json payload is for some methods generated directly in mql5, for others not. The GetQuoteResults is called directly after a connection is established. |
Thank you for confirming. I really though I was doing something wrong. I will try downgrading to 4.8.0. Really appreciated! Migrating the server part seems to be a big project as well, but there seems to be some limited support for WCF now in core from a community project. |
If you downgrade to 4.8.0, you have to re-add some workarounds. Just have a look at this commit for some details (e.g. the CallbackBehaviorAttribute). 91af112
Yep, but requires a better understanding of the mtapi implementation. I think that would be a nice goal to achieve in combination 😉 |
@maartenschalekamp I did some debugging and found the issue for your observed exception. It is not related to the wcf dependencies (which still have another issue on versions greater than 4.8.0), but has something to do with the used .net core version. There is a regression in .net7, it will still work with .net6. Here are two issues I found for this behavior: |
Thank you Lazou. I want able to work on my project for a while. I initially tried to just downgrade to 4.8.0 and then ran into other random issues. Downgraded to .net6 and it works now! |
Hi maartenschalekamp and lazou I like the many changes lazou has done with his fork of vdemydiuk but the latter still has MT4. My use case combines both MT5 and MT4. Unfortunately, Maarten your MT4 development does not appear to be public, so I am not sure what direction to take. What do you recommend? Thanks |
Hi @cshawky, I decided to remove MT4 since I only use MT5 and could not test MT4 for my own. Additionally it made the project setup easier. That said, I personnally recommend the usege of MT5. But at the end it is up to you 😉 |
@lazou that makes perfect sense. However, I am supporting an EA for multiple clients who use MT4 exclusively and their favorite broker does not support MT5. To solve limitations with that EA, the magic sauce needs to be done outside of MT4. I myself have started using MT5 and do like it. For that use case I only need a private copy service. |
Thanks, I've just started on this, with a fork. What is the current status for .net as I note a few different versions from .NET 5, 6 and framework 4.8 selected for different projects. Is it safe for .Net 7 yet or should one stick to an earlier version? |
I think it is totally fine to use NET7, but I have no experience with it until now (still using NET5). So at the end it is up to you. |
Good day,
I am trying to replicate what you have done for MT5 but to do it as well for MT4. When using the MtApiServiceNetCore I am able to connect, but somewhere I believe there is some issue with the data contract or something.
I get the following error:
System.ServiceModel.CommunicationException: 'Service connection failed! The formatter threw an exception while trying to deserialize the message: There was an error while trying to deserialize parameter https://tempuri.org/:GetQuotesResult. The InnerException message was 'There was an error deserializing the object of type System.Collections.Generic.List 1'[[MTApiService.MtQuote, MtApiServiceNetCore, Version=1.0.32.0, Culture=neutral, PublicKeyToken=null]]. The input source is not correctly formatted.'. Please see InnerException for more details.'
and the inner exception.
{"The input source is not correctly formatted."}
Any suggestions on what could be the issue. When using the MtApiService directly does work fine (in dotnet framework).
The text was updated successfully, but these errors were encountered: