Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tell the clr to use the cached assemblies even when it tries to reload them with a different context. #1056

Merged
merged 2 commits into from
Jan 13, 2016

Conversation

matthid
Copy link
Member

@matthid matthid commented Dec 23, 2015

The problem is that in some situations the runtime loads some of the cached assemblies twice in different "load contexts". This leads to missingmethodexceptions or typecastexceptions or similar exceptions.

Currently I have the -nc option (to disable cache) in place as a workaround.

Note: Please read my follow-up in-line comments as well as one of the changes might be breaking some FAKE scripts.

match knownAssemblies.TryGetValue(ev.Name) with
| true, a ->
if printDetails then tracefn "Redirect assembly load to known assembly: %s" ev.Name
a
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be pretty safe.

@matthid matthid force-pushed the razorEngine_caching branch from da6a354 to 8cca852 Compare December 23, 2015 17:04
@matthid
Copy link
Member Author

matthid commented Dec 23, 2015

Ah OK the build failure is unrelated and already in master: https://github.com/fsharp/FAKE/branches
https://travis-ci.org/fsharp/FAKE/builds/98328387

@matthid matthid force-pushed the razorEngine_caching branch from d1fd64a to dd9182e Compare December 23, 2015 18:15
@matthid
Copy link
Member Author

matthid commented Dec 23, 2015

I tried, but this looks like combination of a mono and an fsharp bug. It seems like either mono crashes or AppVeyor is unable to compile the source code (related change 1584779...83bb9a6#diff-f5364baf6fdad3389e2e231ccf698733R7)

@forki
Copy link
Member

forki commented Jan 12, 2016

ready to merge?

@matthid
Copy link
Member Author

matthid commented Jan 12, 2016

Yeah, I think now with comparing the publickeytokens the change is not as problematic as before.

forki added a commit that referenced this pull request Jan 13, 2016
tell the clr to use the cached assemblies even when it tries to reload them with a different context.
@forki forki merged commit 1453662 into fsprojects:master Jan 13, 2016
@matthid matthid deleted the razorEngine_caching branch June 16, 2017 16:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants