Skip to content
This repository has been archived by the owner on Sep 4, 2024. It is now read-only.

Failure to deploy DLLs copied into \bin with a pre/post build event for .NET application #943

Closed
MattDavies opened this issue Jan 2, 2014 · 7 comments
Milestone

Comments

@MattDavies
Copy link

I've noticed that when deploying a new .NET application that has unmanaged DLLs copied in via a pre/post build event (tried both), kudu does not include those files in the list of files synced to an Azure Website.

Repository reproducing this:

http://github.com/MattDavies/KuduSyncReproduction.git

Created as follows:

  1. Create a new Web Application (I used MVC4).
  2. Install-Package LibGit2Sharp (this is an example of a package which needs to copy in files post build).

Generating deployment script output:

Using the following command to generate deployment script: 'azure site deploymentscript -y --no-dot-deployment -r "D:\home\site\repository" -o "D:\home\site\deployments\tools" --aspWAP "D:\home\site\repository\KuduSyncIssue\KuduSyncIssue.csproj" --solutionFile "D:\home\site\repository\KuduSyncIssue.sln"'.
Project file path: .\KuduSyncIssue\KuduSyncIssue.csproj
Solution file path: .\KuduSyncIssue.sln
Generating deployment script for .NET Web Application

Running deployment command output:

Command: D:\home\site\deployments\tools\deploy.cmd
Handling .NET Web Application deployment.
Installing 'LibGit2Sharp 0.15.0.0'.
Installing 'Microsoft.AspNet.Mvc 4.0.30506.0'.
Successfully installed 'Microsoft.AspNet.Mvc 4.0.30506.0'.
Installing 'Microsoft.AspNet.Mvc.FixedDisplayModes 1.0.0'.
Successfully installed 'Microsoft.AspNet.Mvc.FixedDisplayModes 1.0.0'.
Installing 'Microsoft.AspNet.Razor 2.0.30506.0'.
Successfully installed 'LibGit2Sharp 0.15.0.0'.
Successfully installed 'Microsoft.AspNet.Razor 2.0.30506.0'.
Installing 'Microsoft.AspNet.WebApi 4.0.30506.0'.
Installing 'Microsoft.AspNet.WebApi.Client 4.0.30506.0'.
Successfully installed 'Microsoft.AspNet.WebApi 4.0.30506.0'.
Successfully installed 'Microsoft.AspNet.WebApi.Client 4.0.30506.0'.
Installing 'Microsoft.AspNet.WebApi.Core 4.0.30506.0'.
Installing 'Microsoft.AspNet.WebApi.WebHost 4.0.30506.0'.
Successfully installed 'Microsoft.AspNet.WebApi.Core 4.0.30506.0'.
Successfully installed 'Microsoft.AspNet.WebApi.WebHost 4.0.30506.0'.
Installing 'Microsoft.Web.Infrastructure 1.0.0.0'.
Installing 'Microsoft.Net.Http 2.0.20710.0'.
Installing 'Microsoft.AspNet.WebPages 2.0.30506.0'.
Successfully installed 'Microsoft.Web.Infrastructure 1.0.0.0'.
Successfully installed 'Microsoft.Net.Http 2.0.20710.0'.
Successfully installed 'Microsoft.AspNet.WebPages 2.0.30506.0'.
Installing 'Newtonsoft.Json 4.5.11'.
Successfully installed 'Newtonsoft.Json 4.5.11'.
Project file contains ToolsVersion="12.0". This toolset is unknown or missing. You may be able to resolve this by installing the appropriate .NET Framework for this toolset. Treating the project as if it had ToolsVersion="4.0".
  Restoring NuGet packages...
  To prevent NuGet from downloading packages during build, open the Visual Studio Options dialog, click on the Package Manager node and uncheck 'Allow NuGet to download missing packages'.
  All packages listed in packages.config are already installed.
  KuduSyncIssue -> D:\home\site\repository\KuduSyncIssue\bin\KuduSyncIssue.dll
  D:\home\site\repository\.\packages\LibGit2Sharp.0.15.0.0\lib\net35\NativeBinaries\x86\git2-65e9dc6.dll
  D:\home\site\repository\.\packages\LibGit2Sharp.0.15.0.0\lib\net35\NativeBinaries\x86\git2-65e9dc6.pdb
  2 File(s) copied
  D:\home\site\repository\.\packages\LibGit2Sharp.0.15.0.0\lib\net35\NativeBinaries\amd64\git2-65e9dc6.dll
  D:\home\site\repository\.\packages\LibGit2Sharp.0.15.0.0\lib\net35\NativeBinaries\amd64\git2-65e9dc6.pdb
  2 File(s) copied
  ExcludeFilesByExtension
  ExcludeFilesByExtension
  Transformed Web.config using D:\home\site\repository\KuduSyncIssue\Web.Release.config into obj\Release\TransformWebConfig\transformed\Web.config.
  Copying all files to temporary location below for package/publish:
  C:\DWASFiles\Sites\kudubuildtest\Temp\2392aa5e-863e-4c9b-b11e-11140449b9aa.
KuduSync.NET from: 'C:\DWASFiles\Sites\kudubuildtest\Temp\2392aa5e-863e-4c9b-b11e-11140449b9aa' to: 'D:\home\site\wwwroot'
Deleting file: 'hostingstart.html'
Copying file: 'Global.asax'
Copying file: 'packages.config'
Copying file: 'Web.config'
Copying file: 'bin\KuduSyncIssue.dll'
Copying file: 'bin\LibGit2Sharp.dll'
Copying file: 'bin\Microsoft.Web.Infrastructure.dll'
Copying file: 'bin\Microsoft.Web.Mvc.FixedDisplayModes.dll'
Copying file: 'bin\Newtonsoft.Json.dll'
Copying file: 'bin\System.Net.Http.dll'
Copying file: 'bin\System.Net.Http.Formatting.dll'
Copying file: 'bin\System.Net.Http.WebRequest.dll'
Copying file: 'bin\System.Web.Helpers.dll'
Copying file: 'bin\System.Web.Http.dll'
Copying file: 'bin\System.Web.Http.WebHost.dll'
Copying file: 'bin\System.Web.Mvc.dll'
Copying file: 'bin\System.Web.Razor.dll'
Copying file: 'bin\System.Web.WebPages.Deployment.dll'
Copying file: 'bin\System.Web.WebPages.dll'
Copying file: 'bin\System.Web.WebPages.Razor.dll'
Copying file: 'Views\Web.config'
Copying file: 'Views\Home\Index.cshtml'
Finished successfully.

@Gissues:{"order":61.53846153846134,"status":"backlog"}

@davidebbo
Copy link
Member

This is not really a Kudu issue, but an issue with how this package deploys its native binaries. See these steps to repro the same issue on your local machine.

The Microsoft.SqlServer.Compact package also installs native binaries, but does it in a way that works correctly during deployment. Maybe the LibGit2Sharp package can do something similar? /cc @nulltoken

@nulltoken
Copy link
Contributor

@davidebbo Thanks for keeping me in the loop! I've found this (thanks to a google search). Is this the workaround you're referring to?

I'd be happy to make LibGit2Sharp apply some similar magic, but, from a licencing perspective, am I allowed to get some inspiration blatantly copying such code?

/cc @martinwoodward

@martinwoodward
Copy link

From the licensing stand-point I wouldn't have concerns with this getting added to LibGit2Sharp

@davidebbo
Copy link
Member

Yes, this is the exact Microsoft.SqlServer.Compact example I was referring to, and I verified that it works correctly with VS deployment (and Kudu).

@nulltoken
Copy link
Contributor

We're working on tackling this in libgit2/libgit2sharp#700

@nulltoken
Copy link
Contributor

Fixed in libgit2/libgit2sharp#821

@davidebbo
Copy link
Member

Great, closing this one then!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants