C
C#9mo ago
BartShoot

✅ can you put dotnet publish *.dll in some library folder?

I was wondering if there was a way to tidy up result of executing
dotnet publish PrototypeWPF --runtime win-x64 -c Release --self-contained=true -o build-files
dotnet publish PrototypeWPF --runtime win-x64 -c Release --self-contained=true -o build-files
It produces tons of not only *.dlls but also some locale folders, can't i put them away in some libs and locales directory for example? I know there are -p:PublishSingleFile=True and trimming but there are some problems with them.
No description
19 Replies
nohopestage
nohopestage9mo ago
The single file option works fine for me, what problems did you encounter?
BartShoot
BartShootOP9mo ago
this application refuses to start for some reason when I enable this and also the exe gets quite big (I know it's just packed dlls but doesn't look that great) I was just wondering if there is option to manage them, for example in java using maven you can define where the dependencies are going etc so your output would be some libs directory and main.jar which would be equivalent to exe
nohopestage
nohopestage9mo ago
This doesn't let you put dependencies in a separate folder AFAIK, but you can try it as an alternative: https://github.com/Fody/Costura
GitHub
GitHub - Fody/Costura: Embed references as resources
Embed references as resources. Contribute to Fody/Costura development by creating an account on GitHub.
Unknown User
Unknown User9mo ago
Message Not Public
Sign In & Join Server To View
BartShoot
BartShootOP9mo ago
Well yeah, they are put in the same directory as executable. I'd like to move them so potential user could see exe without scrolling for a few seconds
Unknown User
Unknown User9mo ago
Message Not Public
Sign In & Join Server To View
BartShoot
BartShootOP9mo ago
Unsupported for wpf as it uses reflection as per docs
Unknown User
Unknown User9mo ago
Message Not Public
Sign In & Join Server To View
BartShoot
BartShootOP9mo ago
Okay thanks, I was mostly asking if there was another way to manage it - it's not a deal breaker as the app still works 😁 And yeah I'll be trying to rebuild the project in avalonia. When I was testing default project it could be packed to single file and trimmed nicely
Unknown User
Unknown User9mo ago
Message Not Public
Sign In & Join Server To View
Lex Li
Lex Li9mo ago
"potential user could see exe without scrolling for a few seconds" can be an invalid requirement. Why should you ship a folder of files to end users, but not installers which create system shortcuts?
Unknown User
Unknown User9mo ago
Message Not Public
Sign In & Join Server To View
leowest
leowest9mo ago
@BartShoot if all you're doing is single file without trimming you should be able to do it by including IncludeNativeLibrariesForSelfExtract to true in your csproj also u can't use NAOT if available
Unknown User
Unknown User9mo ago
Message Not Public
Sign In & Join Server To View
leowest
leowest9mo ago
yes its not supported but you can still do single file is my point
leowest
leowest9mo ago
No description
Unknown User
Unknown User9mo ago
Message Not Public
Sign In & Join Server To View
leowest
leowest9mo ago
ah ok I guess I missed it along the road of texts here 😉 I remember having to do IncludeNativeLibrariesForSelfExtract for WPF to work for me
MODiX
MODiX9mo ago
Use the /close command to mark a forum thread as answered
Want results from more Discord servers?
Add your server