Skip to content

Commit

Permalink
Make sure assembly search paths for #r directives include directory o…
Browse files Browse the repository at this point in the history
…f declaring source file

fixes dotnet#273
fixes dotnet#293
  • Loading branch information
latkin committed Mar 13, 2015
1 parent 220c17d commit 83e2576
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/fsharp/build.fs
Original file line number Diff line number Diff line change
Expand Up @@ -2705,9 +2705,15 @@ type TcConfig private (data : TcConfigBuilder,validate:bool) =
let isNetModule = String.Compare(ext,".netmodule",StringComparison.OrdinalIgnoreCase)=0
if String.Compare(ext,".dll",StringComparison.OrdinalIgnoreCase)=0
|| String.Compare(ext,".exe",StringComparison.OrdinalIgnoreCase)=0
|| isNetModule then
|| isNetModule then

let resolved = TryResolveFileUsingPaths(tcConfig.SearchPathsForLibraryFiles,m,nm)
let searchPaths =
if m <> range0 && m <> rangeStartup && m <> rangeCmdArgs && FileSystem.IsPathRootedShim m.FileName then
tcConfig.SearchPathsForLibraryFiles @ [Path.GetDirectoryName(m.FileName)]
else
tcConfig.SearchPathsForLibraryFiles

let resolved = TryResolveFileUsingPaths(searchPaths,m,nm)
match resolved with
| Some(resolved) ->
let sysdir = tcConfig.IsSystemAssembly resolved
Expand Down

0 comments on commit 83e2576

Please sign in to comment.