You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Trying to use TrimMode with value full in an iOS .NET8 project in Release configuration.
The app crashes on startup when we are creating an API service with Refit with exception: Terminating app due to uncaught exception 'System.ArgumentException', reason: 'URL /path/{id} has parameter id, but no method parameter matches (System.ArgumentException)
Step to reproduce
Add <TrimMode>full</TrimMode> to any Refit-based .NET8 iOS project into Release configuration
Compile and deploy to a device or simulator
Start the app
Expect a crash on the moment of API services creation
Check Console app for the logs with the exception above
Reproduction repository
No response
Expected behavior
A trimmed app starts without crashes and all API services get registered without exception.
Screenshots 🖼️
No response
IDE
Visual Studio for Mac
Operating system
macOS
Version
Sonoma 14.0
Device
iPhone 12 mini
Refit Version
7.0.0
Additional information ℹ️
It works fine in Debug or without TrimMode in Release.
There is also a workaround to add [AliasAs("id")] to each API method.
[Get("/path")]Task<Response>GetPathAsync(intid,CancellationTokenct);// CRASH[Get("/path")]Task<Response>GetPathAsync([AliasAs("id")]intid,CancellationTokenct);// WORKS
But there are of lot of methods so it's better to be some global fix.
The text was updated successfully, but these errors were encountered:
Describe the bug 🐞
Trying to use
TrimMode
with valuefull
in an iOS .NET8 project in Release configuration.The app crashes on startup when we are creating an API service with Refit with exception:
Terminating app due to uncaught exception 'System.ArgumentException', reason: 'URL /path/{id} has parameter id, but no method parameter matches (System.ArgumentException)
Step to reproduce
<TrimMode>full</TrimMode>
to any Refit-based .NET8 iOS project into Release configurationReproduction repository
No response
Expected behavior
A trimmed app starts without crashes and all API services get registered without exception.
Screenshots 🖼️
No response
IDE
Visual Studio for Mac
Operating system
macOS
Version
Sonoma 14.0
Device
iPhone 12 mini
Refit Version
7.0.0
Additional information ℹ️
It works fine in Debug or without TrimMode in Release.
There is also a workaround to add
[AliasAs("id")]
to each API method.But there are of lot of methods so it's better to be some global fix.
The text was updated successfully, but these errors were encountered: