From cda98c3f0b0a8aaabb027faba0c7f494521c1625 Mon Sep 17 00:00:00 2001 From: domdom Date: Thu, 16 Nov 2017 16:37:18 +1000 Subject: [PATCH] Remove possibly nonexistent extension safely Fixes #2900 --- src/Paket.Core/PaketConfigFiles/InstallModel.fs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Paket.Core/PaketConfigFiles/InstallModel.fs b/src/Paket.Core/PaketConfigFiles/InstallModel.fs index 6e3cb30331..8eb622e0a5 100644 --- a/src/Paket.Core/PaketConfigFiles/InstallModel.fs +++ b/src/Paket.Core/PaketConfigFiles/InstallModel.fs @@ -56,7 +56,10 @@ type MsBuildFile = { module MsBuildFile = let ofFile (f:FrameworkDependentFile) = let fi = FileInfo(normalizePath f.File.FullPath) - let name = fi.Name.Replace(fi.Extension, "") + let name = + let ext = fi.Extension + if String.IsNullOrEmpty ext then fi.Name + else fi.Name.Replace(ext, "") { Name = name; Path = f.File.FullPath } type FrameworkReference = { @@ -924,4 +927,4 @@ type InstallModel with [] static member CreateFromLibs(packageName, packageVersion, frameworkRestriction:FrameworkRestriction, libs : UnparsedPackageFile seq, targetsFiles, analyzerFiles, nuspec : Nuspec) = - InstallModel.createFromLibs packageName packageVersion frameworkRestriction libs targetsFiles analyzerFiles nuspec \ No newline at end of file + InstallModel.createFromLibs packageName packageVersion frameworkRestriction libs targetsFiles analyzerFiles nuspec