C#C
C#3y ago
Sher

❔ Read files from a library

I created a simle library using .NET 7. I have
.json
and .css files in this lib which I need to access during runtime. I tried to use
<CopyToOutputDirectory>Always</CopyToOutputDirectory>

But files get copied to the library output directory, so the main project can't read them.
I can access files using full path to them, but this way I will need to know the ralative path all the time, which I don't really like.
How can fix the issue?
Was this page helpful?