Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/fsharp/vs/service.fs
Original file line number Diff line number Diff line change
Expand Up @@ -2383,7 +2383,7 @@ type FSharpProjectFileInfo (fsprojFileName:string, ?properties, ?enableLogging)
]

let references =
[ for i in project.GetEvaluatedItemsByName("ResolvedFiles") do
[ for i in project.GetEvaluatedItemsByName("ReferencePath") do
yield i.FinalItemSpec
for fsproj in projectReferences do
match (try let p' = projectFromFile fsproj
Expand Down
121 changes: 121 additions & 0 deletions tests/service/ProjectOptionsTests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -236,5 +236,126 @@ let ``Project file parsing -- multi language project``() =
checkOption options.OtherOptions "ConsoleApplication2.exe"
checkOption options.OtherOptions "ConsoleApplication3.exe"

[<Test>]
let ``Project file parsing -- PCL profile7 project``() =
let f = normalizePath (__SOURCE_DIRECTORY__ + @"../../projects/Sample_VS2013_FSharp_Portable_Library_net45/Sample_VS2013_FSharp_Portable_Library_net45.fsproj")

let options = checker.GetProjectOptionsFromProjectFile(f)
let references =
options.OtherOptions
|> Array.choose (fun o -> if o.StartsWith("-r:") then o.[3..] |> (Path.GetFileName >> Some) else None)
|> Set.ofArray
references
|> shouldEqual
(set [|"FSharp.Core.dll"; "Microsoft.CSharp.dll"; "Microsoft.VisualBasic.dll";
"System.Collections.Concurrent.dll"; "System.Collections.dll";
"System.ComponentModel.Annotations.dll";
"System.ComponentModel.DataAnnotations.dll";
"System.ComponentModel.EventBasedAsync.dll"; "System.ComponentModel.dll";
"System.Core.dll"; "System.Diagnostics.Contracts.dll";
"System.Diagnostics.Debug.dll"; "System.Diagnostics.Tools.dll";
"System.Diagnostics.Tracing.dll"; "System.Dynamic.Runtime.dll";
"System.Globalization.dll"; "System.IO.Compression.dll"; "System.IO.dll";
"System.Linq.Expressions.dll"; "System.Linq.Parallel.dll";
"System.Linq.Queryable.dll"; "System.Linq.dll"; "System.Net.Http.dll";
"System.Net.NetworkInformation.dll"; "System.Net.Primitives.dll";
"System.Net.Requests.dll"; "System.Net.dll"; "System.Numerics.dll";
"System.ObjectModel.dll"; "System.Reflection.Context.dll";
"System.Reflection.Extensions.dll"; "System.Reflection.Primitives.dll";
"System.Reflection.dll"; "System.Resources.ResourceManager.dll";
"System.Runtime.Extensions.dll";
"System.Runtime.InteropServices.WindowsRuntime.dll";
"System.Runtime.InteropServices.dll"; "System.Runtime.Numerics.dll";
"System.Runtime.Serialization.Json.dll";
"System.Runtime.Serialization.Primitives.dll";
"System.Runtime.Serialization.Xml.dll"; "System.Runtime.Serialization.dll";
"System.Runtime.dll"; "System.Security.Principal.dll";
"System.ServiceModel.Duplex.dll"; "System.ServiceModel.Http.dll";
"System.ServiceModel.NetTcp.dll"; "System.ServiceModel.Primitives.dll";
"System.ServiceModel.Security.dll"; "System.ServiceModel.Web.dll";
"System.ServiceModel.dll"; "System.Text.Encoding.Extensions.dll";
"System.Text.Encoding.dll"; "System.Text.RegularExpressions.dll";
"System.Threading.Tasks.Parallel.dll"; "System.Threading.Tasks.dll";
"System.Threading.dll"; "System.Windows.dll"; "System.Xml.Linq.dll";
"System.Xml.ReaderWriter.dll"; "System.Xml.Serialization.dll";
"System.Xml.XDocument.dll"; "System.Xml.XmlSerializer.dll"; "System.Xml.dll";
"System.dll"; "mscorlib.dll"|])

checkOption options.OtherOptions "--targetprofile:netcore"

[<Test>]
let ``Project file parsing -- PCL profile78 project``() =
let f = normalizePath (__SOURCE_DIRECTORY__ + @"../../projects/Sample_VS2013_FSharp_Portable_Library_net451_adjusted_to_profile78/Sample_VS2013_FSharp_Portable_Library_net451.fsproj")

let options = checker.GetProjectOptionsFromProjectFile(f)
let references =
options.OtherOptions
|> Array.choose (fun o -> if o.StartsWith("-r:") then o.[3..] |> (Path.GetFileName >> Some) else None)
|> Set.ofArray
references
|> shouldEqual
(set [|"FSharp.Core.dll"; "Microsoft.CSharp.dll"; "System.Collections.dll";
"System.ComponentModel.EventBasedAsync.dll"; "System.ComponentModel.dll";
"System.Core.dll"; "System.Diagnostics.Contracts.dll";
"System.Diagnostics.Debug.dll"; "System.Diagnostics.Tools.dll";
"System.Dynamic.Runtime.dll"; "System.Globalization.dll"; "System.IO.dll";
"System.Linq.Expressions.dll"; "System.Linq.Queryable.dll"; "System.Linq.dll";
"System.Net.NetworkInformation.dll"; "System.Net.Primitives.dll";
"System.Net.Requests.dll"; "System.Net.dll"; "System.ObjectModel.dll";
"System.Reflection.Extensions.dll"; "System.Reflection.Primitives.dll";
"System.Reflection.dll"; "System.Resources.ResourceManager.dll";
"System.Runtime.Extensions.dll";
"System.Runtime.InteropServices.WindowsRuntime.dll";
"System.Runtime.Serialization.Json.dll";
"System.Runtime.Serialization.Primitives.dll";
"System.Runtime.Serialization.Xml.dll"; "System.Runtime.Serialization.dll";
"System.Runtime.dll"; "System.Security.Principal.dll";
"System.ServiceModel.Http.dll"; "System.ServiceModel.Primitives.dll";
"System.ServiceModel.Security.dll"; "System.ServiceModel.Web.dll";
"System.ServiceModel.dll"; "System.Text.Encoding.Extensions.dll";
"System.Text.Encoding.dll"; "System.Text.RegularExpressions.dll";
"System.Threading.Tasks.dll"; "System.Threading.dll"; "System.Windows.dll";
"System.Xml.Linq.dll"; "System.Xml.ReaderWriter.dll";
"System.Xml.Serialization.dll"; "System.Xml.XDocument.dll";
"System.Xml.XmlSerializer.dll"; "System.Xml.dll"; "System.dll"; "mscorlib.dll"|])

checkOption options.OtherOptions "--targetprofile:netcore"

[<Test>]
let ``Project file parsing -- PCL profile259 project``() =
let f = normalizePath (__SOURCE_DIRECTORY__ + @"../../projects/Sample_VS2013_FSharp_Portable_Library_net451_adjusted_to_profile259/Sample_VS2013_FSharp_Portable_Library_net451.fsproj")

let options = checker.GetProjectOptionsFromProjectFile(f)
let references =
options.OtherOptions
|> Array.choose (fun o -> if o.StartsWith("-r:") then o.[3..] |> (Path.GetFileName >> Some) else None)
|> Set.ofArray
references
|> shouldEqual
(set [|"FSharp.Core.dll"; "Microsoft.CSharp.dll"; "System.Collections.dll";
"System.ComponentModel.EventBasedAsync.dll"; "System.ComponentModel.dll";
"System.Core.dll"; "System.Diagnostics.Contracts.dll";
"System.Diagnostics.Debug.dll"; "System.Diagnostics.Tools.dll";
"System.Dynamic.Runtime.dll"; "System.Globalization.dll"; "System.IO.dll";
"System.Linq.Expressions.dll"; "System.Linq.Queryable.dll"; "System.Linq.dll";
"System.Net.NetworkInformation.dll"; "System.Net.Primitives.dll";
"System.Net.Requests.dll"; "System.Net.dll"; "System.ObjectModel.dll";
"System.Reflection.Extensions.dll"; "System.Reflection.Primitives.dll";
"System.Reflection.dll"; "System.Resources.ResourceManager.dll";
"System.Runtime.Extensions.dll";
"System.Runtime.InteropServices.WindowsRuntime.dll";
"System.Runtime.Serialization.Json.dll";
"System.Runtime.Serialization.Primitives.dll";
"System.Runtime.Serialization.Xml.dll"; "System.Runtime.Serialization.dll";
"System.Runtime.dll"; "System.Security.Principal.dll";
"System.ServiceModel.Web.dll"; "System.Text.Encoding.Extensions.dll";
"System.Text.Encoding.dll"; "System.Text.RegularExpressions.dll";
"System.Threading.Tasks.dll"; "System.Threading.dll"; "System.Windows.dll";
"System.Xml.Linq.dll"; "System.Xml.ReaderWriter.dll";
"System.Xml.Serialization.dll"; "System.Xml.XDocument.dll";
"System.Xml.XmlSerializer.dll"; "System.Xml.dll"; "System.dll"; "mscorlib.dll"|])

checkOption options.OtherOptions "--targetprofile:netcore"

#endif