❔ how to reference all dlls in separate folder such as "bin" or "lib"
self explanatory title
19 Replies
visual studio 2022
<Reference Include="lib/*.dll" />
i guess?are you consuming libraries that aren't available on nuget or something?
@Yorki
I used costura fody
To bundle all DLLs into one
so I only got one dll I got to reference
@jcotton42
is that not automatic?
also, there's native stuff for this now
!!! 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.
tried the native stuff but it created a folder full of dlls
did you publish or just build?
$singlefile
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: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-publishCreate 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.
build
Yea it created a file with even more dlls
that's why
it only affects publish
Oh
I've never published
How do you publish
read the blurb that @MODiX spat out
What are the differences between publish and release
Either way how do I put them all in a bin file is my question
release is a configuration you can build or publish in
they're orthogonal
like the dll
that's what singlefile publish is for
Oh ok
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.