Api payload empty in release mode mvvmcross, works everywhere else? #4693
Replies: 2 comments
-
MvvmCross doesn't do anything special with your code. However, some parts of MvvmCross relies on reflection and due to that, linkers/trimmers cannot figure out whether certain parts of your code is actually being used. Since, in Debug configurations the linker doesn't run or is less aggressive, you don't see the issue there. You will need to find out which parts of your code is stripped out and hint the linker that it is actually being used. You can see an example of that here: https://github.com/MvvmCross/MvvmCross/blob/develop/Projects/Playground/Playground.Droid/LinkerPleaseInclude.cs |
Beta Was this translation helpful? Give feedback.
-
Thanks Tomasz,
You were right, It turned out I had to add my custom assembly to be
excluded from linker. All is working now.
…On Fri, Sep 15, 2023 at 9:46 AM Tomasz Cielecki ***@***.***> wrote:
MvvmCross doesn't do anything special with your code. However, some parts
of MvvmCross relies on reflection and due to that, linkers/trimmers cannot
figure out whether certain parts of your code is actually being used.
Since, in Debug configurations the linker doesn't run or is less
aggressive, you don't see the issue there.
You will need to find out which parts of your code is stripped out and
hint the linker that it is actually being used.
You can see an example of that here:
https://github.com/MvvmCross/MvvmCross/blob/develop/Projects/Playground/Playground.Droid/LinkerPleaseInclude.cs
—
Reply to this email directly, view it on GitHub
<#4693 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AIOYRVECV4XA2D456PYVPRTX2QBTVANCNFSM6AAAAAA4ZLN6DA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
I'm trying to post Json data to a web api from a mvvmcross project, it works in debug mode but as soon as I switch over to release the payload is empty when received by the API.
It works in all other project types that runs in release except mvvmcore?
Any idea what would casue this?
Code
var jsonPayload = new StringContent(JsonConvert.SerializeObject(request),Encoding.UTF8, Client.ContentType); httpResponse = Client.HttpClient.PostAsync(endpoint, jsonPayload).Result;
Beta Was this translation helpful? Give feedback.
All reactions