c# - Best way to manage resources(Not necessarily RESX files) in .Net solution -


this sounded trivial question did not come across solid/best practice solution on how asking question here. now, let's imagine have work couple of ".txt" files in our code in class library.

now, think there 3 major ways handle this:

  • just put in bin/debug/resources folder of calling application , in code use "resources\*.txt". think simplest , unobtrusive way handle this. however, there many trivial problems it:

    • when check in source control not check-in files inside bin/debug folder

    • so in case, adding folder 1 level above , writting post-build scripts efficient option guess?

  • add resources folder on same level bin folder. way can manage using source control. when need reference through our code becomes tricky

    • we can reference files assuming binary folder's structure bin/debug , reference resources folder ..\..\resources

    • but structure not guaranteed if binary folder structure bin/ (without debug folder in it) ../../resources going fail

  • add txt files .resx files. not sure if practice around everywhere , popular way store resources.

    -also, code have write access resources files sounds cumbersome oppose picking file windows file system.

probably missing trivial curious , thinking should more simpler this. suggestions?

create different project in solution called myproject.resources. next install microsoft mat , manage translations mat: https://developer.microsoft.com/en-us/windows/develop/multilingual-app-toolkit

you manage translations mat , .resx files kept up-to-date. ;-)


Comments

Popular posts from this blog

apache - PHP Soap issue while content length is larger -

asynchronous - Python asyncio task got bad yield -

javascript - Complete OpenIDConnect auth when requesting via Ajax -