MSBuilld copies unwanted files from Azure WebJob to another WebJob

115 views Asked by At

We have 2 Azure Webjobs connected to our ASP WebApi application. None of them is using any dependencies from the other one. And yet, after publishing, one of them has executables from the other one. It's worth mantioning that this only happens on publish. Everything is normal on VS build.

This is how files hierachy looks like on Azure FTP

FTP WebJobs file structure

The first one, Deployment, is being published as expected. Those are executables in it's folder:

Executables in Deployment WebJob

The second one, EmailSender, has executables from the Deployment:

Executables in EmailSender WebJob

What's curious, there is also app.publish folder in both of them, containing only one and the same file WebJob.Deployment.exe:

App.publish folder

Deployment job works fine. Unfortunately Azure don't recognize EmailSender job, instead it executes Deployment. The only solution that works right now is to manualy delete Deployment's executables directly from FTP, on every publish.

Right now we tried couple of things from SO and blogs, but with no success.

Edit: I did accomplished something. It did not resolve the problem, but we don't have app.publish folder anymore. Here is the link to solution on SO. I don't know why we had 'ClickOnce security' options checked for WebJob.Deployment application.

Update: I run few tests with MSBuild and found something curious. As I said before, Visual Studio Publish works just fine - no additional executables are deployed. But when I run MSBuildprogram (with the same publish profile and project configuration) I got additional Deployment.exe inside EmailsSender folder. This is the command I run:

MSBuild RestAPI.Host.csproj /t:Build /p:Configuration="Develop" /p:Platform="AnyCPU" /p:DocumentationFile="RestAPI.Host.XML" /p:DeployOnBuild="true" /p:PublishProfile="fakebuild_develop.pubxml" /p:OutputPath="backend\build\app\\" /p:SolutionDir="backend\\"

Can someone tell me what's the difference between MSBuild and VS Publish? I cannot find anything usefull on the internet.

0

There are 0 answers