在 Azure 上使用 DAC(数据层应用程序)包 API
我有一个小型应用程序,它使用与 powerscript 示例相同的 API 从 dacpac(数据层应用程序)升级数据库。
为了让它在没有安装任何 SQL Server 工具的 Windows 2008 服务器上运行,我必须引用大量 dll,并在这些 dll 上选择“复制本地”以将它们放入我的编译文件夹中。这很好用。
我现在想从 Azure 上的辅助角色调用相同的 API。但是当我运行它(使用相同的 dll)时,我得到
“System.IO.FileLoadException:无法加载文件或程序集 “Microsoft.SqlServer.BatchParser.dll”或其依赖项之一。这 应用程序无法启动,因为它的并行配置 是不正确的。请查看应用程序事件日志”
当我部署到本地模拟器时,它工作正常。
我还无法从日志中获取任何有意义的信息(不确定我的诊断是否正确)。
提到的文件位于已发布的包中我找到了 2 个版本的 teh 文件,但另一个版本是 32 位,如果我尝试它,我(可以理解)会遇到 BadFormat 异常。
以下是我引用的 dll:
ADODB, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
Microsoft.Build.Utilities.v3.5, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL
Microsoft.CSharp
Microsoft.ReportViewer.Common, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL
Microsoft.ReportViewer.ProcessingObjectModel, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL
Microsoft.SqlServer.BatchParser
Microsoft.SqlServer.BatchParserClient
Microsoft.SqlServer.ConnectionInfo, Version=10.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL
Microsoft.SqlServer.Diagnostics.STrace, Version=10.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL
Microsoft.SqlServer.Dmf, Version=10.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL
Microsoft.SqlServer.Management.Dac, Version=10.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL
Microsoft.SqlServer.Management.DacEnum, Version=10.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL
Microsoft.SqlServer.Management.DacSerialization, Version=10.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL
Microsoft.SqlServer.Management.Sdk.Sfc, Version=10.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL
Microsoft.SqlServer.Management.SmoMetadataProvider, Version=10.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL
Microsoft.SqlServer.Management.SqlParser, Version=10.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL
Microsoft.SqlServer.ServiceBrokerEnum, Version=10.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL
Microsoft.SqlServer.Smo, Version=10.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL
Microsoft.SqlServer.SqlClrProvider, Version=10.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL
Microsoft.SqlServer.SqlEnum, Version=10.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL
Microsoft.WindowsAzure.Diagnostics, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
Microsoft.WindowsAzure.ServiceRuntime
Microsoft.WindowsAzure.StorageClient, Version=1.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
System
System.Configuration
System.Core
System.Data
System.Data.DataSetExtensions
System.Data.Entity.Design
System.Deployment
System.Drawing
System.Windows.Forms
System.Xml
System.Xml.Linq
WindowsBase
我缺少什么想法吗?
I have a small application that uses the same API as the powerscript examples for upgrading a database from a dacpac (data-tier application).
To get it working on a Windows 2008 server without any SQL Server tools installed I had to refernce a lot of dlls and choose "Copy Local" on those dlls to get them into my compile folder. This works fine.
I now want to call the same API from a worker role on Azure. But when I run it (with same dlls) I get
"System.IO.FileLoadException: Could not load file or assembly
'Microsoft.SqlServer.BatchParser.dll' or one of its dependencies. The
application has failed to start because its side-by-side configuration
is incorrect. Please see the application event log"
It works fine when I deploy to local emulator.
I haven't yet been able to get anything meaningful from the logs (not sure if I have my diagnostics right).
The file mentioned is in the published package. I have found 2 versions of teh file but the other version is 32 bit and I (understandably) get a BadFormat exception if I try it.
Here are the dlls I'm referencing:
ADODB, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
Microsoft.Build.Utilities.v3.5, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL
Microsoft.CSharp
Microsoft.ReportViewer.Common, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL
Microsoft.ReportViewer.ProcessingObjectModel, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL
Microsoft.SqlServer.BatchParser
Microsoft.SqlServer.BatchParserClient
Microsoft.SqlServer.ConnectionInfo, Version=10.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL
Microsoft.SqlServer.Diagnostics.STrace, Version=10.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL
Microsoft.SqlServer.Dmf, Version=10.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL
Microsoft.SqlServer.Management.Dac, Version=10.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL
Microsoft.SqlServer.Management.DacEnum, Version=10.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL
Microsoft.SqlServer.Management.DacSerialization, Version=10.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL
Microsoft.SqlServer.Management.Sdk.Sfc, Version=10.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL
Microsoft.SqlServer.Management.SmoMetadataProvider, Version=10.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL
Microsoft.SqlServer.Management.SqlParser, Version=10.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL
Microsoft.SqlServer.ServiceBrokerEnum, Version=10.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL
Microsoft.SqlServer.Smo, Version=10.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL
Microsoft.SqlServer.SqlClrProvider, Version=10.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL
Microsoft.SqlServer.SqlEnum, Version=10.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL
Microsoft.WindowsAzure.Diagnostics, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
Microsoft.WindowsAzure.ServiceRuntime
Microsoft.WindowsAzure.StorageClient, Version=1.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
System
System.Configuration
System.Core
System.Data
System.Data.DataSetExtensions
System.Data.Entity.Design
System.Deployment
System.Drawing
System.Windows.Forms
System.Xml
System.Xml.Linq
WindowsBase
Any ideas wht I'm missing?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我想我已经破解了这个。我启用了对虚拟机的远程访问,这意味着我可以访问应用程序事件。运行我的辅助角色后,我在事件查看器中收到错误消息,指出找不到 microsoft.vc80.crt。
我没有找到该名称的 dll,但我
在这个文件夹中找到了:
它指向我还包含的其他 3 个 dll:
到目前为止,我只运行了一次升级,但希望现在已经完成。如果我发现/解决更多问题,我会在这里更新。
希望这对某人有帮助。
I think I have cracked this. I enabled remote access to the VM which meant I had access to the application events. After running my worker role I got an error in the event viewer saying that it couldn't find microsoft.vc80.crt.
I didn't find a dll by that name but I found
in this folder:
It points to 3 other dlls which I also included:
I have only run the upgrade once so far, but hopefully this is done now. If I find/fix any more problems I will update here.
Hope this helps someone.