How do I replace embedded resources in a .NET assembly programmatically?

前端 未结 1 1666
囚心锁ツ
囚心锁ツ 2020-12-29 04:56

I am trying to replace a Resource of an exe (.NET, C#) file using C# code.

I have found this article and made this code (using Mono.Cecil 0.6):

Assembl         


        
相关标签:
1条回答
  • 2020-12-29 05:47

    Trying to do this seems overly complex. If you need dynamic update of resources, ship your resources as a folder for your application (set items in the folder as content and copy if newer in project properties).

    If you need dynamic update at runtime, then it's as simple as either:

    1] Allow user to replace items in place or
    2] Even better, treat it like word-press themes and allow an override folder for each resource.

    If you need to tag each resource with metadata you could use a sqlite database or even easier, allow a matching .meta file for each resource to describe it in more detail.

    Finally, if you are allowing digital download of your software, then you might consider code-signing your executable - in which case modifying the executable in any way will not be an option.

    0 讨论(0)
提交回复
热议问题