Can I modify the content of an embedded resource (text/xml file) in a .NET application

喜夏-厌秋 提交于 2019-11-29 11:45:12

Nope. An embedded resource is a set of bytes in the assembly.

Its like trying to modify the code in your assembly, after compiling.

This would be doubly bad if your assembly has been signed.

If you're trying to swap resources in and out, you can move your resources into a separate (satellite) assembly, and swap that assembly at deployment time.

What are you trying to achieve?

No, you can't change embedded resources.

You might want to consider copying the resource out to disk on start up, if it doesn't already exist, but using an existing file if it's already there (in which case it may have been modified).

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!