NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

/Fx (Merge Injected Code)

/Fx

/Fx produces a copy of each source file with injected code merged into the source.

To distinguish a merged source file from an original source file, /Fx adds a .mrg extension between the filename and file extension. For example, suppose you have a file named MyCode.cpp that contains attributed code, building the project with /Fx creates a file named MyCode.mrg.cpp that contains the following code,

//+++ Start Injected Code
[no_injected_text(true)];      // Suppress injected text, it has already been injected
#pragma warning(disable: 4543) // Suppress warnings about skipping injected text
#pragma warning(disable: 4199) // Suppress warnings from attribute providers
//--- End Injected Code

In a .mrg file, code that was injected because of an attribute will be delimited as follows:

//+++ Start Injected Code
...
//--- End Injected Code

The no_injected_text attribute is embedded in a .mrg file, which allows for the compilation of the .mrg file without text being reinjected.

You should be aware that .mrg source file is intended to be a representation of the source code injected by the compiler. The .mrg file may not compile or run exactly as the original source file.

Macros are not expanded in the .mrg file.

If your program includes a header file that uses injected code, /Fx generates .mrg.h file for that header. /Fx does not merge include files that do not use injected code.

See Also

Output-File (/F) Options | Compiler Options | Setting Compiler Options