A
A
Andrey Ovsyankin2014-05-19 16:15:22
.NET
Andrey Ovsyankin, 2014-05-19 16:15:22

How to inject an arbitrary resource into a .NET assembly?

There is some configuration xml file and there is an exe that reads it and performs the actions described in this XML. It is necessary to somehow programmatically combine them into one executable file, according to the principle of a self-extracting archive.
For example, let's say the executing module is called processor.exe. We wrote the xml-config config.xml and run some program that will take config.xml and inject it inside processor.exe.
The output should be one file, which, when run, will read the config inside itself and execute it.
How to do something like this?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
T
trerums, 2014-05-19
@trerums

If I understood you correctly, then use the assembly linker (al.exe) with the /embed parameter that comes with the .net framework

A
Alexey, 2014-05-24
@HaJIuBauKa

In this case, you better understand how to work with resources in C#.
In general, reading them is simple, but how to load an exe into a ready-made assembly - here you need to delve into MSDN and forums.
msdn.microsoft.com/en-us/library/zabda143(v=vs.90).aspx

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question