0

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.

Sebastian Budka
  • 396
  • 1
  • 8
  • 19
  • Have you add reference of Deployment to EmailSender? I add reference and get the `Deployment.exe` in EmailSender webjob. Also, I didn't see `app.publish` folder in them, could you show me more details about how to reproduce your problem? Here is a [similar](https://stackoverflow.com/questions/52839343/azure-web-job-run-command-incorrectly-set) issue you could refer to. – Joey Cai Nov 08 '18 at 05:38
  • Nice, didn't find that SO question before. Unfortunately, like I wrote in question, I don't have references between WebJobs. I took a closer look at all of projects dependencies, and none of them reference any of WebJob, so there cannot be an indirect reference. I will try to put some more detailes today. – Sebastian Budka Nov 08 '18 at 07:25
  • Also, you could try to create two new webjob to check if you could reproduce it. Hope to hear you good news. – Joey Cai Nov 08 '18 at 07:31
  • I figured out what's that weird app.publish folder... https://stackoverflow.com/questions/30142229/what-creates-the-directory-app-publish-in-visual-studio-2013 – Sebastian Budka Nov 13 '18 at 07:55
  • Glad to see that you solve the problem by yourself. – Joey Cai Nov 13 '18 at 07:58
  • I am not sure if the problem is solve, I'm testing it rght now. I just get rid of unused app.publish folder, but wrong executables might still be there – Sebastian Budka Nov 13 '18 at 08:08
  • Unfortunately it does not work.It seems that problem was not connected to app.publish folder. Updating my question to provide more details. – Sebastian Budka Nov 13 '18 at 10:39
  • @JoeyCai I added additional info to the question – Sebastian Budka Nov 16 '18 at 08:43
  • 1
    The difference between them is that the MSBuild has its own configuration while the Visual Studio has more other information or configuration parameters offered based on MSBuild. So in the environment of VS, it will be generally more complicated. For more details, you could refer to this [article](https://learn.microsoft.com/en-us/aspnet/web-forms/overview/deployment/web-deployment-in-the-enterprise/understanding-the-project-file). – Joey Cai Nov 27 '18 at 02:12

0 Answers0