简体   繁体   中英

Editing a C# resource file of a compiled assembly

I have a resource file where I am storing connection string etc for a class library (I cant use an App.config, don't ask why). It was my assumption (might be a stupid one) that I would be able to modify the .rex file out side of the complied assembly at runtime to be able to change connection string through environments without recompiling the assembly each time, can someone verify my assumption and if possible tell me how to do it?

Cheers

You can disassemble assembly, edit resources and assemble it again.

You can find some info here .

If it's a text resource, you may try to just replace the characters.

I have successfully modified a SQL query which was included in .EXE assembly with Notepad++. I made sure though, that the number of characters was not altered.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM