Search code examples
msbuildmsdeploy

MSDeploy error: library not found DbSqlPackage


Heads up: I'm a total MSDeploy noob. In fact, this is my first attempt at creating a msbuild script and I'm only recently started looking into msdeploy.

Now that that's out of the way, I'm writing a build script to compile and package my ASP.Net webforms application. The script can compile the solution, however, I'm getting the following error when attempting to package:

Microsoft.Web.Deployment.DeploymentException: The library 'Microsoft.Data.Tools.Schema.DbSqlPackage, Version=10.3.0.0, ...' could not be loaded.

I've searched the web but I can't seem to find any instances of this issue (specific to the missing DbSqlPackage.dll). I assume this has something to do with the ability to package and deploy databases referenced in the solution.

I am using MSDeploy V3 and MSBuild v4.0.30319. The Package target of the .build file is as follows:

<Target Name="Package" DependsOnTargets="Compile">
<PropertyGroup>
  <PackageDir>%(PackageFile.RootDir)%(PackageFile.Directory)</PackageDir>
  <Source>%(Website.FullPath)</Source>
  <Destination>%(PackageFile.FullPath)</Destination>
</PropertyGroup>
<MakeDir Directories="$(PackageDir)" />
<Exec Command='"@(MsDeploy)" -verb:sync -source:iisApp="$(Source)" -dest:package="$(Destination)"' />

I am not trying to include any databases and I would be happy if there is a switch that I can set to bypass the error all together. However, if anyone knows how to FIX and not just avoid the issue, that would be preferred.

Thanks in advance.

Vinney


Solution

  • I tried to repair the installation of MS Web Deploy but no dice. Except, my filter terms "web deploy" turned up another item in my installed programs: "Web Deploy dbSqlPackage Provider" (or something along those lines... it's late). The build/package completes after removing this program.

    It only took me half a day to find this solution... oh well!