NetPad: Error when trying to connect to SQL server

After configure the user, pass, select database and check connection, when try to access database structure in Connections Panel, it shows me the following error:

image image

One or more errors occurred. (Scaffolding process failed with exit code: 1. dotnet-ef tool output:
Build started...
Build succeeded.
To protect potentially sensitive information in your connection string, you should move it out of source code. You can avoid scaffolding the connection string by using the Name= syntax to read it from configuration - see https://go.microsoft.com/fwlink/?linkid=2131148. For more guidance on storing connection strings, see http://go.microsoft.com/fwlink/?LinkId=723263.
System.PlatformNotSupportedException: Strings.PlatformNotSupported_DataSqlClient
   at Microsoft.Data.SqlClient.SqlConnection..ctor(String connectionString) in /_/artifacts/Project/obj/Release.AnyCPU/Microsoft.Data.SqlClient/netcore/netcoreapp3.1/Microsoft.Data.SqlClient.notsupported.cs:line 386
   at Microsoft.EntityFrameworkCore.SqlServer.Scaffolding.Internal.SqlServerDatabaseModelFactory.Create(String connectionString, DatabaseModelFactoryOptions options)
   at Microsoft.EntityFrameworkCore.Scaffolding.Internal.ReverseEngineerScaffolder.ScaffoldModel(String connectionString, DatabaseModelFactoryOptions databaseOptions, ModelReverseEngineerOptions modelOptions, ModelCodeGenerationOptions codeOptions)
   at Microsoft.EntityFrameworkCore.Design.OperationExecutor.ScaffoldContextImpl(String provider, String connectionString, String outputDir, String outputDbContextDir, String dbContextClassName, IEnumerable`1 schemaFilters, IEnumerable`1 tableFilters, String modelNamespace, String contextNamespace, Boolean useDataAnnotations, Boolean overwriteFiles, Boolean useDatabaseNames, Boolean suppressOnConfiguring, Boolean noPluarlize)
   at Microsoft.EntityFrameworkCore.Design.OperationExecutor.OperationBase.<>c__DisplayClass3_0`1.<Execute>b__0()
   at Microsoft.EntityFrameworkCore.Design.OperationExecutor.ScaffoldContext.<>c__DisplayClass0_0.<.ctor>b__0()
   at Microsoft.EntityFrameworkCore.Design.OperationExecutor.OperationBase.Execute(Action action)
Strings.PlatformNotSupported_DataSqlClient)

.NET SDK and Runtime installed

image

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 19 (7 by maintainers)

Most upvoted comments

@faahiero Could you try upgrading dotnet-ef tool?

dotnet tool update --global dotnet-ef --version 8.0.*

or to the latest 6.0 version

dotnet tool update --global dotnet-ef --version 6.0.*

image

image

No, still the same! But thanks anyway!

At first glance, both Electron and vNext are super fast to startup!

@faahiero @RichardNobel @stephenkirk can you try the new version and let me know if you’re still seeing this problem. If the same issue persists, we should now see more error details.

Thanks for confirming. I’ll check out the issue with the tree view. Can you please post dotnet --info?

Sure, here:

.NET SDK:
 Version:           8.0.106
 Commit:            ab2d260803
 Workload version:  8.0.100-manifests.8f6aae10

Ambiente de runtime:
 OS Name:     endeavouros
 OS Version:  
 OS Platform: Linux
 RID:         arch-x64
 Base Path:   /usr/share/dotnet/sdk/8.0.106/

Cargas de trabalho do .NET instaladas:
 Workload version: 8.0.100-manifests.8f6aae10
 [wasm-tools]
   Origem da Instalação: SDK 8.0.100
   Versão do Manifesto:    8.0.6/8.0.100
   Caminho do Manifesto:       /usr/share/dotnet/sdk-manifests/8.0.100/microsoft.net.workload.mono.toolchain.current/8.0.6/WorkloadManifest.json
   Tipo de Instalação:        FileBased

 [wasm-tools-net6]
   Origem da Instalação: SDK 8.0.100
   Versão do Manifesto:    8.0.6/8.0.100
   Caminho do Manifesto:       /usr/share/dotnet/sdk-manifests/8.0.100/microsoft.net.workload.mono.toolchain.net6/8.0.6/WorkloadManifest.json
   Tipo de Instalação:        FileBased


Host:
  Version:      8.0.6
  Architecture: x64
  Commit:       3b8b000a0e

.NET SDKs installed:
  6.0.131 [/usr/share/dotnet/sdk]
  7.0.120 [/usr/share/dotnet/sdk]
  8.0.106 [/usr/share/dotnet/sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 6.0.31 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 7.0.20 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 8.0.6 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 6.0.31 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 7.0.20 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 8.0.6 [/usr/share/dotnet/shared/Microsoft.NETCore.App]

Other architectures found:
  None

Environment variables:
  Not set

global.json file:
  Not found

Learn more:
  https://aka.ms/dotnet/info

Download .NET:
  https://aka.ms/dotnet/download

@RichardNobel thanks for the report. A .NET 6 Runtime or SDK is needed for the treeview to work correctly but I’m not sure yet if it being missing on your machine is what’s causing this particular issue. Do you mind installing .NET 6 Runtime or SDK, restarting NetPad and see if you still get the same error?

And you can get to that window you were looking for by clicking the computer icon on the bottom right corner of the main window.

Thanks for confirming. I’ll check out the issue with the tree view. Can you please post dotnet --info?