Generate a unique ID at compile time to work around a CLR bug#438
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Alternative to #437 that generates a GUID at compile time and makes it accessible as a const String. The String is then used as the value for MarshalCookie on all custom marshaler declarations. The MarshalCookie is used in the hash key by the CLR when caching ICustomMarshalers. This will allow multiple LibGit2Sharp assemblies to co-exist and use custom marshalers.
The build task is not as clean as I would like it to be, because XBuild is limited in its functionality in a few ways. (We can't use inline C# code, for example, with the CodeTaskFactory.) I would prefer not to have the .DLL be checked into the repository, but it looks like the only way to get what we want here. Incremental build still works, too.