Skip to content

Commit

Permalink
accept the cached assembly when the public token of the given assembl…
Browse files Browse the repository at this point in the history
…y is null.

This makes Assembly.Load calls with simple assembly names work.
Fixes #1199
  • Loading branch information
matthid committed Apr 6, 2016
1 parent a362ff2 commit 8dcfa9a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/app/FakeLib/FSIHelper.fs
Original file line number Diff line number Diff line change
Expand Up @@ -259,16 +259,19 @@ let private getCacheInfoFromScript printDetails fsiOptions scriptPath =
if printDetails then tracefn "Redirect assembly load to known assembly: %s" ev.Name
a
| _ ->
let token = name.GetPublicKeyToken()
match loadedAssemblies
|> Seq.map snd
|> Seq.tryFind (fun asem ->
let n = asem.GetName()
n.Name = name.Name &&
n.GetPublicKeyToken() = name.GetPublicKeyToken()) with
(isNull token || // When null accept what we have.
n.GetPublicKeyToken() = token)) with
| Some (asem) ->
traceFAKE "Redirect assembly from '%s' to '%s'" ev.Name asem.FullName
asem
| _ ->
if printDetails then traceFAKE "Could not resolve '%s'" ev.Name
null))
assemVersionValidCount = Seq.length cacheConfig.Value.Assemblies
else
Expand Down

0 comments on commit 8dcfa9a

Please sign in to comment.