Jelle
Explore posts from servers❔ Distributing a CLI app (with .NET 8 Native AOT)
Hi guys, I built a CLI app that I'd like to distribute to the major platforms (windows, mac, linux). I'm trying to deal with building and distributing the app now that I have a version that I'm happy with, though I'm running into some issues..
I thought that with .NET 8's improved Native AOT, it'd be perfect to write my app targeting that. The app's use is that it makes it easy to create files and directories etc. so I honestly don't think a self-contained app is suitable for this use-case because how can I ask people to install 100MB+ for such a simple app (though maybe I can)?
I'm using
CommandLineParser
for dealing with the argument parsing, and using DotNetYaml
in also a relatively critical part of the app, both are throwing Native AOT warnings and Trim warnings.
The app crashes when creating the Options object from CommandLineParser.Parser.ParseArguments
.. (this doesn't happen when running it locally with the debugger attached, only when running the executable that was built with Native AOT with dotnet publish
)
The exception I'm currently hitting reads as follows:
It honestly seems quite a lot like it's coming from the Trim and/or AOT warnings when building the project.
There's a few questions I'd like to ask:
1. Any advice on how I can deal with the exception?
2. Is it even worth it for me to dig into this issue? There may be plenty more even if I solve the one I'm currently encountering
3. Am I overreacting regarding size? I guess I could just release a self-contained app but like I mentioned above, I feel like the size is too big to justify the use-case
4. Any tips or examples on proper open-source CLI apps built on .net? I'm honestly quite lost especially regarding distributing them but I'm also starting to think building it on dotnet wasnt a great choice4 replies
❔ HMAC encrypt a string
Hey guys I'm trying to HMAC encrypt a string but the resulting hash is being rejected by the server I want to use it on. It's returning
400 Bad Request
: "Please provide a valid HMAC hash"
I'm trying to achieve this: https://docs.novu.co/notification-center/client/react/get-started#enabling-hmac-encryption
With my code looking like this:
I'm wondering if I'm just doing it wrong or if there's something else perhaps.. I triple checked the values I'm using and they should be correct
The hash that I output is 18A22B366AF133C8ADD62E471BB3F91984D12E495CD4EC33999DEE8B48722E39
16 replies
❔ Getting cross-platform directories for storing data
Hey guys, I'm writing a CLI app with .NET 8 and I'm looking into storing config and caches on the filesystem.
I was wondering if there's some utility similar to this https://github.com/sindresorhus/env-paths#api that automatically picks the right path based on the OS and what the file is for?
6 replies