dotnet / interactive

.NET Interactive combines the power of .NET with many other languages to create notebooks, REPLs, and embedded coding experiences. Share code, explore data, write, and learn across your apps in ways you couldn't before.
MIT License
2.88k stars 382 forks source link

Unrecognized command or argument 'mssql'. #3393

Open peymanx opened 9 months ago

peymanx commented 9 months ago

Dotnet Interactive MSSQL

I'm using the latest version of VSCODE and follow the instructions but some error happens and says: Error: The required command was not provided.

Code:

#r "nuget:Microsoft.DotNet.Interactive.SqlServer,*-*"
#!connect mssql --kernel-name mydatabase "Persist Security Info=False; Integrated Security=true; Initial Catalog=MyDatabase; Server=localhost"

Output:

Unrecognized command or argument 'mssql'.
Unrecognized command or argument '--kernel-name'.
Unrecognized command or argument 'mydatabase'.
Unrecognized command or argument 'Persist Security Info=False; Integrated Security=true; Initial Catalog=MyDatabase; Server=localhost'.

I know I should customize Connection string, but error is somewhere else

Please complete the following:

.NET Interactive © 2020 Microsoft Corporation Version: 1.0.345202+1f7cb23c53cee7fedf47418a0b0321090034af16 Library version: 1.0.0-beta.22452.2+1f7cb23c53cee7fedf47418a0b0321090034af16

Build date: 2023-10-07T11:18:50.4361748Z

Screenshots

image

ichivers commented 9 months ago

I also get the same.

VSCode MacOS Microsoft.dotnet-interactive version 1.0.461101

Additionally I get the following error when trying to create a db context:

!connect mssql --create-dbcontext --kernel-name myKernel "Data Source=

Error: System.InvalidOperationException: /Users/ianchivers/.dotnet/tools/MicrosoftSqlToolsServiceLayer failed to start properly. Exit code: 150. ---> StreamJsonRpc.ConnectionLostException: The JSON-RPC connection with the remote party was lost before the request could complete. ---> System.OperationCanceledException: The operation was canceled. at System.Threading.CancellationToken.ThrowOperationCanceledException() at System.Threading.CancellationToken.ThrowIfCancellationRequested() at StreamJsonRpc.MessageHandlerBase.WriteAsync(JsonRpcMessage content, CancellationToken cancellationToken) at StreamJsonRpc.JsonRpc.SendAsync(JsonRpcMessage message, CancellationToken cancellationToken) at StreamJsonRpc.JsonRpc.InvokeCoreAsync(JsonRpcRequest request, Type expectedResultType, CancellationToken cancellationToken) --- End of inner exception stack trace --- at StreamJsonRpc.JsonRpc.InvokeCoreAsync(JsonRpcRequest request, Type expectedResultType, CancellationToken cancellationToken) at StreamJsonRpc.JsonRpc.InvokeCoreAsync[TResult](RequestId id, String targetName, IReadOnlyList1 arguments, IReadOnlyList1 positionalArgumentDeclaredTypes, IReadOnlyDictionary`2 namedArgumentDeclaredTypes, CancellationToken cancellationToken, Boolean isParameterObject) at Microsoft.DotNet.Interactive.SqlServer.ToolsServiceClient.ConnectAsync(ConnectParams connectParams) --- End of inner exception stack trace --- at Microsoft.DotNet.Interactive.SqlServer.ToolsServiceClient.ConnectAsync(ConnectParams connectParams) at Microsoft.DotNet.Interactive.SqlServer.ToolsServiceClientExtensions.ConnectAsync(ToolsServiceClient serviceClient, Uri ownerUri, String connectionStr) at Microsoft.DotNet.Interactive.SqlServer.MsSqlKernel.ConnectAsync() at Microsoft.DotNet.Interactive.SqlServer.MsSqlKernelConnector.CreateKernelAsync(String kernelName) at Microsoft.DotNet.Interactive.SqlServer.ConnectMsSqlCommand.ConnectKernelsAsync(KernelInvocationContext context, InvocationContext commandLineContext) at Microsoft.DotNet.Interactive.CompositeKernel.<>cDisplayClass21_0.<b__0>d.MoveNext() in D:\a_work\1\s\src\Microsoft.DotNet.Interactive\CompositeKernel.cs:line 271 --- End of stack trace from previous location --- at System.CommandLine.NamingConventionBinder.CommandHandler.GetExitCodeAsync(Object returnValue, InvocationContext context) at System.CommandLine.NamingConventionBinder.ModelBindingCommandHandler.InvokeAsync(InvocationContext context) at System.CommandLine.Invocation.InvocationPipeline.<>cDisplayClass4_0.<b0>d.MoveNext() --- End of stack trace from previous location --- at System.CommandLine.Builder.CommandLineBuilderExtensions.<>cDisplayClass15_0.<b0>d.MoveNext() --- End of stack trace from previous location --- at System.CommandLine.Builder.CommandLineBuilderExtensions.<>cDisplayClass12_0.<b0>d.MoveNext() --- End of stack trace from previous location --- at System.CommandLine.Builder.CommandLineBuilderExtensions.<>cDisplayClass19_0.<b0>d.MoveNext() --- End of stack trace from previous location --- at System.CommandLine.Invocation.InvocationPipeline.gFullInvocationChainAsync|2_0(InvocationContext context) at System.CommandLine.Parsing.ParseResultExtensions.InvokeAsync(ParseResult parseResult, IConsole console) at Microsoft.DotNet.Interactive.Commands.DirectiveCommand.InvokeAsync(KernelInvocationContext context) in D:\a_work\1\s\src\Microsoft.DotNet.Interactive\Commands\DirectiveCommand.cs:line 33 at Microsoft.DotNet.Interactive.Kernel.HandleAsync(KernelCommand command, KernelInvocationContext context) in D:\a_work\1\s\src\Microsoft.DotNet.Interactive\Kernel.cs:line 330 at Microsoft.DotNet.Interactive.KernelCommandPipeline.b__60(KernelCommand command, KernelInvocationContext context, KernelPipelineContinuation ) in D:\a_work\1\s\src\Microsoft.DotNet.Interactive\KernelCommandPipeline.cs:line 60 at Microsoft.DotNet.Interactive.KernelCommandPipeline.SendAsync(KernelCommand command, KernelInvocationContext context) in D:\a_work\1\s\src\Microsoft.DotNet.Interactive\KernelCommandPipeline.cs:line 41