File tree Expand file tree Collapse file tree 1 file changed +11
-8
lines changed Expand file tree Collapse file tree 1 file changed +11
-8
lines changed Original file line number Diff line number Diff line change @@ -23,20 +23,23 @@ type internal DesignTimeConnectionString =
2323
2424 static member ReadFromConfig ( name , resolutionFolder , fileName ) =
2525 let configFilename =
26- if fileName <> " "
27- then
26+ if fileName <> " " then
2827 let path = Path.Combine( resolutionFolder, fileName)
2928 if not <| File.Exists path
3029 then raise <| FileNotFoundException( sprintf " Could not find config file '%s '." path)
3130 else path
3231 else
3332 // note: these filenames are case sensitive on linux
34- let appConfig = Path.Combine( resolutionFolder, " App.config" )
35- let webConfig = Path.Combine( resolutionFolder, " Web.config" )
36-
37- if File.Exists appConfig then appConfig
38- elif File.Exists webConfig then webConfig
39- else failwithf " Cannot find either App.config or Web.config."
33+ let file =
34+ seq { yield " app.config"
35+ yield " App.config"
36+ yield " web.config"
37+ yield " Web.config" }
38+ |> Seq.map ( fun v -> Path.Combine( resolutionFolder, v))
39+ |> Seq.tryFind File.Exists
40+ match file with
41+ | None -> failwithf " Cannot find either App.config or Web.config."
42+ | Some file -> file
4043
4144 let map = ExeConfigurationFileMap()
4245 map.ExeConfigFilename <- configFilename
You can’t perform that action at this time.
0 commit comments