Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sqlpackage import fails with error 'Json serialization is not supported on .NET Core' #510

Open
abydal opened this issue Oct 14, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@abydal
Copy link

abydal commented Oct 14, 2024

I get an error importing a database from a customer. This is a procedure I have done dozens of times, so don't really understand whats different now.
From what I can see it complains about the files in /Data being json-formatted, but is this reallly a new thing?

  • SqlPackage or DacFx Version: 162.4.92.3
  • .NET Framework (Windows-only) or .NET Core: NET8
  • Environment (local platform and source/target platforms): Windows - trying to import to both Azure Sql and local docker instance with Sql Server

I don't really know how the backpac file was produced but I get this exception when I try to import it:

Data plan execution failed with message One or more errors occurred. (One or more errors occurred. (One or more errors occurred. (Json serialization is not supported on .NET Core)))
 Exception: Microsoft.SqlServer.Dac.Data.DataException: Data plan execution failed with message One or more errors occurred. (One or more errors occurred. (One or more errors occurred. (Json serialization is not supported on .NET Core)))
 ---> System.AggregateException: One or more errors occurred. (One or more errors occurred. (One or more errors occurred. (Json serialization is not supported on .NET Core)))
 ---> System.AggregateException: One or more errors occurred. (One or more errors occurred. (Json serialization is not supported on .NET Core))
 ---> System.AggregateException: One or more errors occurred. (Json serialization is not supported on .NET Core)
 ---> System.PlatformNotSupportedException: Json serialization is not supported on .NET Core
   at Microsoft.Data.Tools.Schema.Sql.Dac.Data.Import.ImportTablePartHelper.ImportTableParts() in C:\__w\1\s\Source\SchemaSql\Dac\Data\Import\ImportTablePartHelper.cs:line 68
   at Microsoft.Data.Tools.Schema.Sql.Dac.Data.Import.ImportTableHelper.ImportTableParts(ImportTableMetadata tableMetadata, IEnumerable`1 partUris) in C:\__w\1\s\Source\SchemaSql\Dac\Data\Import\ImportTableHelper.cs:line 326
   at Microsoft.Data.Tools.Schema.Sql.Dac.Data.Import.ImportTableHelper.<>c__DisplayClass57_0.<StartImportTableParts>b__0() in C:\__w\1\s\Source\SchemaSql\Dac\Data\Import\ImportTableHelper.cs:line 315
   at Microsoft.Data.Tools.Schema.Sql.Dac.Logging.DacLogContext.<>c__DisplayClass22_0.<AddContext>b__0() in C:\__w\1\s\Source\SchemaSql\Dac\Logging\DacLogContext.cs:line 203
   at Microsoft.Data.Tools.Schema.Sql.Dac.Data.Import.ImportBacpacHelper.PackageReaderTaskFactory.<>c__DisplayClass5_0.<GetExecutableAction>b__0() in C:\__w\1\s\Source\SchemaSql\Dac\Data\Import\ImportBacpacHelper.cs:line 539
   at Microsoft.Data.Tools.Schema.Sql.Dac.Logging.DacLogContext.<>c__DisplayClass22_0.<AddContext>b__0() in C:\__w\1\s\Source\SchemaSql\Dac\Logging\DacLogContext.cs:line 203
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location ---
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)
   --- End of inner exception stack trace ---
   --- End of inner exception stack trace ---
   --- End of inner exception stack trace ---
   at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
   at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
   at System.Threading.Tasks.Task.Wait()
   at Microsoft.Data.Tools.Schema.Sql.Dac.Data.Import.ImportBacpacHelper.ImportBacpac() in C:\__w\1\s\Source\SchemaSql\Dac\Data\Import\ImportBacpacHelper.cs:line 284
   at Microsoft.Data.Tools.Schema.Sql.Dac.Data.ImportTablesStep.Execute() in C:\__w\1\s\Source\SchemaSql\Dac\Data\ImportTablesStep.cs:line 67
   at Microsoft.Data.Tools.Schema.Sql.Deployment.Steps.DacBulkCopyStep.Execute(IDbConnection conn, CancellationToken token, LoggingContext loggingContext) in C:\__w\1\s\Source\SchemaSql\Deployment\Steps\DacBulkCopyStep.cs:line 92
   at Microsoft.Data.Tools.Schema.Sql.Deployment.SqlPlanDeployment.Execute(DeploymentPlanHandle plan, SqlConnectionFactory connectionFactory, String targetDatabaseName, Boolean IsAzureTarget, String databaseScriptPath, String masterScriptPath, CancellationToken cancelToken, LoggingContext loggingContext)
   at Microsoft.SqlServer.Dac.Deployment.PlanExecutor.Execute(DeploymentPlan plan, SqlConnectionFactory connectionFactory, Boolean isAzureTarget, LoggingContext loggingContext, CancellationToken cancelToken) in C:\__w\1\s\Source\DeploymentApi\Deployment\PlanExecutor.cs:line 93

Any help will be appreciated here 🙏

@abydal abydal added the bug Something isn't working label Oct 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant