1

Closed

Microsoft.SqlServer.Types NuGet package fails to create folders in F# projects

description

See discussion on GitHub https://github.com/fsprojects/FSharp.Data.SqlClient/issues/70

In short, Microsoft.SqlServer.Types NuGet package tries to create SqlServerTypes\x86 and SqlServerTypes\x64 folders and adds a couple of dlls into them. Here is what the result looks like after the package is successfully added into a C# project:

Image

If you try to add the package into a F# project you will get the following errors:
Package Manager Console Host Version 2.8.50313.46

Type 'get-help NuGet' to see all available NuGet commands.

PM> Install-Package Microsoft.SqlServer.Types
Installing 'Microsoft.SqlServer.Types 11.0.1'.
You are downloading Microsoft.SqlServer.Types from Microsoft, the license agreement to which is available at http://go.microsoft.com/fwlink/?LinkId=331280. Check the package for additional dependencies, which may come with their own license agreement(s). Your use of the package and dependencies constitutes your acceptance of their license agreements. If you do not accept the license agreement(s), then delete the relevant components from your device.
Successfully installed 'Microsoft.SqlServer.Types 11.0.1'.
Adding 'Microsoft.SqlServer.Types 11.0.1' to Microsoft.SqlServer.Types.Test.
Successfully added 'Microsoft.SqlServer.Types 11.0.1' to Microsoft.SqlServer.Types.Test.
Where-Object : Cannot bind parameter 'FilterScript'. Cannot convert the "Name" value of type "System.String" to type "System.Management.Automation.ScriptBlock".
At L:\git\Microsoft.SqlServer.Types.Test\packages\Microsoft.SqlServer.Types.11.0.1\tools\install.ps1:11 char:50
+ $folderx86 = $sqlServerTypes.ProjectItems | where <<<<  Name -eq "x86"
    + CategoryInfo          : InvalidArgument: (:) [Where-Object], ParameterBindingException
    + FullyQualifiedErrorId : CannotConvertArgumentNoMessage,Microsoft.PowerShell.Commands.WhereObjectCommand
 
Cannot find an overload for "AddFolder" and the argument count: "1".
At L:\git\Microsoft.SqlServer.Types.Test\packages\Microsoft.SqlServer.Types.11.0.1\tools\install.ps1:14 char:56
+     $folderx86 = $sqlServerTypes.ProjectItems.AddFolder <<<< ("x86")
    + CategoryInfo          : NotSpecified: (:) [], MethodException
    + FullyQualifiedErrorId : MethodCountCouldNotFindBest
 
Where-Object : Cannot bind parameter 'FilterScript'. Cannot convert the "Name" value of type "System.String" to type "System.Management.Automation.ScriptBlock".
At L:\git\Microsoft.SqlServer.Types.Test\packages\Microsoft.SqlServer.Types.11.0.1\tools\install.ps1:17 char:50
+ $folderx64 = $sqlServerTypes.ProjectItems | where <<<<  Name -eq "x64"
    + CategoryInfo          : InvalidArgument: (:) [Where-Object], ParameterBindingException
    + FullyQualifiedErrorId : CannotConvertArgumentNoMessage,Microsoft.PowerShell.Commands.WhereObjectCommand
 
Cannot find an overload for "AddFolder" and the argument count: "1".
At L:\git\Microsoft.SqlServer.Types.Test\packages\Microsoft.SqlServer.Types.11.0.1\tools\install.ps1:20 char:56
+     $folderx64 = $sqlServerTypes.ProjectItems.AddFolder <<<< ("x64")
    + CategoryInfo          : NotSpecified: (:) [], MethodException
    + FullyQualifiedErrorId : MethodCountCouldNotFindBest
 
Where-Object : Cannot bind parameter 'FilterScript'. Cannot convert the "Name" value of type "System.String" to type "System.Management.Automation.ScriptBlock".
At L:\git\Microsoft.SqlServer.Types.Test\packages\Microsoft.SqlServer.Types.11.0.1\tools\install.ps1:23 char:46
+ $cppLinkx86 = $folderx86.ProjectItems | where <<<<  Name -eq "msvcr100.dll"
    + CategoryInfo          : InvalidArgument: (:) [Where-Object], ParameterBindingException
    + FullyQualifiedErrorId : CannotConvertArgumentNoMessage,Microsoft.PowerShell.Commands.WhereObjectCommand
 
You cannot call a method on a null-valued expression.
At L:\git\Microsoft.SqlServer.Types.Test\packages\Microsoft.SqlServer.Types.11.0.1\tools\install.ps1:26 char:54
+     $cppLinkx86 = $folderx86.ProjectItems.AddFromFile <<<< ($cppBinaryPathx86)
    + CategoryInfo          : InvalidOperation: (AddFromFile:String) [], RuntimeException
    + FullyQualifiedErrorId : InvokeMethodOnNull
 
You cannot call a method on a null-valued expression.
At L:\git\Microsoft.SqlServer.Types.Test\packages\Microsoft.SqlServer.Types.11.0.1\tools\install.ps1:27 char:32
+     $cppLinkx86.Properties.Item <<<< ("CopyToOutputDirectory").Value = 1
    + CategoryInfo          : InvalidOperation: (Item:String) [], RuntimeException
    + FullyQualifiedErrorId : InvokeMethodOnNull
 
Where-Object : Cannot bind parameter 'FilterScript'. Cannot convert the "Name" value of type "System.String" to type "System.Management.Automation.ScriptBlock".
At L:\git\Microsoft.SqlServer.Types.Test\packages\Microsoft.SqlServer.Types.11.0.1\tools\install.ps1:30 char:46
+ $sqlLinkx86 = $folderx86.ProjectItems | where <<<<  Name -eq "SqlServerSpatial110.dll"
    + CategoryInfo          : InvalidArgument: (:) [Where-Object], ParameterBindingException
    + FullyQualifiedErrorId : CannotConvertArgumentNoMessage,Microsoft.PowerShell.Commands.WhereObjectCommand
 
You cannot call a method on a null-valued expression.
At L:\git\Microsoft.SqlServer.Types.Test\packages\Microsoft.SqlServer.Types.11.0.1\tools\install.ps1:33 char:54
+     $sqlLinkx86 = $folderx86.ProjectItems.AddFromFile <<<< ($sqlBinaryPathx86)
    + CategoryInfo          : InvalidOperation: (AddFromFile:String) [], RuntimeException
    + FullyQualifiedErrorId : InvokeMethodOnNull
 
You cannot call a method on a null-valued expression.
At L:\git\Microsoft.SqlServer.Types.Test\packages\Microsoft.SqlServer.Types.11.0.1\tools\install.ps1:34 char:32
+     $sqlLinkx86.Properties.Item <<<< ("CopyToOutputDirectory").Value = 1
    + CategoryInfo          : InvalidOperation: (Item:String) [], RuntimeException
    + FullyQualifiedErrorId : InvokeMethodOnNull
 
Where-Object : Cannot bind parameter 'FilterScript'. Cannot convert the "Name" value of type "System.String" to type "System.Management.Automation.ScriptBlock".
At L:\git\Microsoft.SqlServer.Types.Test\packages\Microsoft.SqlServer.Types.11.0.1\tools\install.ps1:37 char:46
+ $cppLinkx64 = $folderx64.ProjectItems | where <<<<  Name -eq "msvcr100.dll"
    + CategoryInfo          : InvalidArgument: (:) [Where-Object], ParameterBindingException
    + FullyQualifiedErrorId : CannotConvertArgumentNoMessage,Microsoft.PowerShell.Commands.WhereObjectCommand
 
You cannot call a method on a null-valued expression.
At L:\git\Microsoft.SqlServer.Types.Test\packages\Microsoft.SqlServer.Types.11.0.1\tools\install.ps1:40 char:54
+     $cppLinkx64 = $folderx64.ProjectItems.AddFromFile <<<< ($cppBinaryPathx64)
    + CategoryInfo          : InvalidOperation: (AddFromFile:String) [], RuntimeException
    + FullyQualifiedErrorId : InvokeMethodOnNull
 
You cannot call a method on a null-valued expression.
At L:\git\Microsoft.SqlServer.Types.Test\packages\Microsoft.SqlServer.Types.11.0.1\tools\install.ps1:41 char:32
+     $cppLinkx64.Properties.Item <<<< ("CopyToOutputDirectory").Value = 1
    + CategoryInfo          : InvalidOperation: (Item:String) [], RuntimeException
    + FullyQualifiedErrorId : InvokeMethodOnNull
 
Where-Object : Cannot bind parameter 'FilterScript'. Cannot convert the "Name" value of type "System.String" to type "System.Management.Automation.ScriptBlock".
At L:\git\Microsoft.SqlServer.Types.Test\packages\Microsoft.SqlServer.Types.11.0.1\tools\install.ps1:44 char:46
+ $sqlLinkx64 = $folderx64.ProjectItems | where <<<<  Name -eq "SqlServerSpatial110.dll"
    + CategoryInfo          : InvalidArgument: (:) [Where-Object], ParameterBindingException
    + FullyQualifiedErrorId : CannotConvertArgumentNoMessage,Microsoft.PowerShell.Commands.WhereObjectCommand
 
You cannot call a method on a null-valued expression.
At L:\git\Microsoft.SqlServer.Types.Test\packages\Microsoft.SqlServer.Types.11.0.1\tools\install.ps1:47 char:54
+     $sqlLinkx64 = $folderx64.ProjectItems.AddFromFile <<<< ($sqlBinaryPathx64)
    + CategoryInfo          : InvalidOperation: (AddFromFile:String) [], RuntimeException
    + FullyQualifiedErrorId : InvokeMethodOnNull
 
You cannot call a method on a null-valued expression.
At L:\git\Microsoft.SqlServer.Types.Test\packages\Microsoft.SqlServer.Types.11.0.1\tools\install.ps1:48 char:32
+     $sqlLinkx64.Properties.Item <<<< ("CopyToOutputDirectory").Value = 1
    + CategoryInfo          : InvalidOperation: (Item:String) [], RuntimeException
    + FullyQualifiedErrorId : InvokeMethodOnNull
 

PM> 
and x86 and x64 folders are absent in SqlServerTypes folder.
Closed Jan 27, 2015 at 7:29 PM by KevinRansom
Manage at github

comments