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?
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.