C
C#2y ago
vamaiotu

❔ how to reference all dlls in separate folder such as "bin" or "lib"

self explanatory title
19 Replies
vamaiotu
vamaiotuOP2y ago
visual studio 2022
ero
ero2y ago
<Reference Include="lib/*.dll" /> i guess?
jcotton42
jcotton422y ago
are you consuming libraries that aren't available on nuget or something? @Yorki
vamaiotu
vamaiotuOP2y ago
I used costura fody To bundle all DLLs into one so I only got one dll I got to reference @jcotton42
jcotton42
jcotton422y ago
is that not automatic? also, there's native stuff for this now
jcotton42
jcotton422y ago
!!! READ THIS !!! Package is in maintenance mode !!! READ THIS !!! In .NET Core 3 there are two new features: Single-file executables Assembly linking With these features included in the dotnet tool set, the value proposition of Costura is greatly diminished. Therefore we strongly recommend to try out the alternatives mentioned above.
https://github.com/Fody/Costura#-read-this--package-is-in-maintenance-mode--read-this-
GitHub
GitHub - Fody/Costura: Embed references as resources
Embed references as resources. Contribute to Fody/Costura development by creating an account on GitHub.
vamaiotu
vamaiotuOP2y ago
tried the native stuff but it created a folder full of dlls
jcotton42
jcotton422y ago
did you publish or just build? $singlefile
MODiX
MODiX2y ago
dotnet publish -c Release -r <runtime identifier> -p:PublishSingleFile=true Use of -r|--runtime implies --self-contained true. Add --self-contained false to publish as runtime-dependent. -r RID and -p:PublishSingleFile=true can be moved to .csproj as the following properties:
<RuntimeIdentifier>RID</RuntimeIdentifier>
<PublishSingleFile>true</PublishSingleFile>
<RuntimeIdentifier>RID</RuntimeIdentifier>
<PublishSingleFile>true</PublishSingleFile>
but to target multiple RIDs, you have to use dotnet publish with the -r option for each RID. You can also add -p:IncludeNativeLibrariesForSelfExtract=true to include native libraries (like Common Language Runtime dlls) in the output executable. You might want to instead publish your application compiled Ahead Of Time to native code, see $nativeaot for examples. https://docs.microsoft.com/en-us/dotnet/core/deploying/single-file https://docs.microsoft.com/en-us/dotnet/core/rid-catalog https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-publish
Create a single file for application deployment - .NET
Learn what single file application is and why you should consider using this application deployment model.
.NET Runtime Identifier (RID) catalog
Learn about the runtime identifier (RID) and how RIDs are used in .NET.
vamaiotu
vamaiotuOP2y ago
build Yea it created a file with even more dlls
jcotton42
jcotton422y ago
that's why it only affects publish
vamaiotu
vamaiotuOP2y ago
Oh I've never published How do you publish
jcotton42
jcotton422y ago
read the blurb that @MODiX spat out
vamaiotu
vamaiotuOP2y ago
What are the differences between publish and release Either way how do I put them all in a bin file is my question
jcotton42
jcotton422y ago
release is a configuration you can build or publish in they're orthogonal
vamaiotu
vamaiotuOP2y ago
like the dll
jcotton42
jcotton422y ago
that's what singlefile publish is for
vamaiotu
vamaiotuOP2y ago
Oh ok
Accord
Accord2y ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server