Skip to content

Commit

Permalink
Add Caveat section in the readme file
Browse files Browse the repository at this point in the history
Explain how to workaround AppContext switches interference and mention issue Fody#633.
  • Loading branch information
0xced committed Jan 12, 2021
1 parent 2812f3c commit 58b821c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ This will copy embedded files to disk before loading them into memory. This is h
<Costura CreateTemporaryAssemblies='true' />
```

⚠️ Beware when setting `CreateTemporaryAssemblies` to `true`, see the <a href="#Caveat">Caveat</a> section for explanation.

### IncludeDebugSymbols

Expand Down Expand Up @@ -307,6 +308,11 @@ Or as a attribute with items delimited by a pipe `|`.
<Costura PreloadOrder='Foo|Bar' />
```

## Caveat

Embedding native libraries and/or setting `CreateTemporaryAssemblies` to `true` interferes with the .NET Framework [AppContext switches](https://docs.microsoft.com/en-us/dotnet/framework/configure-apps/file-schema/runtime/appcontextswitchoverrides-element). See [issue #633](https://github.com/Fody/Costura/issues/633) for a detailed explanation.

In order to get system AppContext switches properly initialized, you must set <a href="#LoadAtModuleInit">`LoadAtModuleInit`</a> to `false` and manually call `CosturaUtility.Initialize()` in your code (see the CosturaUtility section just below).

## CosturaUtility

Expand Down

0 comments on commit 58b821c

Please sign in to comment.