Ole*_*han 4 sql-server dacpac .net-core
我想migrate从我的应用程序net 4.6.1到netcore2.0一些问题 Microsoft.SqlServer.Dac已经发生.我正在.dacpac使用文件从文件部署数据库DacServices (Microsoft.SqlServer.Dac 1.0.1),但这package supports只是net 4.6.1.如何.dacpac从netcore应用程序部署文件?谢谢你的回答!
该.NET Core支持DacFx计划,但还没有实现,你不能做这种方式在.NET Core.现在如果添加NuGet包Microsoft.SqlServer.DacFx.x64恢复将打印出来:
使用'.NETFramework,Version = v4.6.1'而不是项目目标框架'.NETCoreApp,Version = v2.0'恢复包'Microsoft.SqlServer.DacFx.x64 140.3881.1'
有一段时间,您可以使用命令行实用程序 SqlPackage.exe
SqlPackage.exe
/Action:Publish
/SourceFile:C:/file.dacpac
/TargetConnectionString:[Connection string]
Run Code Online (Sandbox Code Playgroud)
您可以通过编程方式运行它:
var process = new System.Diagnostics.Process();
var startInfo = new System.Diagnostics.ProcessStartInfo
{
WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden,
FileName = @"C:\Program Files (x86)\Microsoft SQL Server\<Version>\DAC\bin\SqlPackage.exe",
Arguments = "/Action:Publish /SourceFile:C:/file.dacpac /TargetConnectionString:[Connection string]"
};
process.StartInfo = startInfo;
process.Start();
Run Code Online (Sandbox Code Playgroud)
截至 2018 年 11 月 15 日的好消息:
...支持netcoreapp2.1和net46的预览包: https://www.nuget.org/packages/Microsoft.SqlServer.DACFx/150.4240.1-preview
请注意,它是 Microsoft.SqlServer.DacFx nuget 包,而不是 Microsoft.SqlServer.DacFx.x86 或 Microsoft.SqlServer.DacFx.x64 包,并且您需要在 nuget 中启用预发布模式。
在同一线程中讨论:
https://github.com/Microsoft/DACExtensions/issues/20#issuecomment-439222493
接下来,我需要看看它是否有效......
| 归档时间: |
|
| 查看次数: |
2019 次 |
| 最近记录: |