Azure-webjobs-sdk: Make WebJobs.Publish compatible with NuGet v3 protocol (PackageReference)

Created on 13 Apr 2017  ·  20Comments  ·  Source: Azure/azure-webjobs-sdk

Hello,

When installing the package into a console application using the new PackageReference mode, the publish as Azure WebJob fails.

Repro steps

  1. Configure NuGet package manager to use "PackageReference" mode.

  2. Create an empty console application (.Net 4.6)

  3. Install Microsoft.Web.WebJobs.Publish package.

  4. Publish

Expected behavior

Build targets are imported and the WebJob is published.

Actual behavior

The build targets aren't imported and publish fails with the error

The target “MSDeployPublish” does not exist in the project

Known workarounds

Manually add the following line to webjob csproj:
<Import Project="$(NuGetPackageRoot)Microsoft.Web.WebJobs.Publish\1.0.13\tools\webjobs.targets" Condition="Exists('$(NuGetPackageRoot)Microsoft.Web.WebJobs.Publish\1.0.13\tools\webjobs.targets')" />

Related information

Package SlowCheetah v.2.5.48 adds a new build target and works correctly with the new NuGet spec.
The build targets are located in the build section of the package:
image

The WebJob.Publish package lists the targets in the tools section along with the scripts, that are no longer supported (Powershell script support was modified to no longer execute install and uninstall scripts, but init scripts are still executed.):

image

  • Package version - 1.0.13

Regards,
Stan

Most helpful comment

Would be nice if Microsoft can provide changelog for this package... or literally open source it :)

All 20 comments

I'll follow up with the tooling folks to see might be happening here.

Any updates ?

@christopheranderson did you follow up?

@christopheranderson ping

@christopheranderson do yo damn job

I've done my job and sent the follow up email.

image

hello, any news on this?

Is the Microsoft.Web.WebJobs.Publish project in github some where and open source as I can't find it any where and have a massive issue with it and would like to see what is could be so I can open a bug then might get fixed. But not holding my breath after reading this thread. Come on MS, post the code and let the community help.

@juliekoubova unfortunately, we don't have a specific update on the status of this issue at the moment, it is currently scheduled for the Visual Studio 2017.7 release (internal bug number 446297 for reference).

@LRomano72 the code for that package is not currently open source. If the issue you're experiencing isn't the one this thread is in relation to, please use the report a problem feature of Visual Studio to get an issue filed with the details of what you're running in to - this will get the issue into the hands of the engineering team.

@mlorbetske Is this still on target for the VS2017.7 release?

@phatcher I just sent the changes out for code review. This is still targeting the VS2017.7 release

https://www.nuget.org/packages/EPI.Web.WebJobs.Publish.NuGetProtocol3/

Temp solution to this problem. I repackaged the webjobs.targets and updated the wap.targets and console.targets to conform to protocol 3. Instead of the Microsoft package, you can include this one and get the deployable zip file to contain the binaries needed for web jobs.

@Kressilac Thanks, I'll give a try

I tested the package with VS 2017 15.5.6 deployment and it worked for me. Until Microsoft pushes a release, the package I posted should do the job correctly.

@mlorbetske The VS 2017.7 is out but the package hasn't been updated yet.

Would be nice if Microsoft can provide changelog for this package... or literally open source it :)

The issue has been resolved with ver 2.0.0 of the package

Can someone show a working configuration for Microsoft.Web.WebJobs.Publish 2.0.0 package. There is no documentation about how to use it.

@DerekLiang You just install it, compile the project, then right click - publish as azure web job.

Was this page helpful?
0 / 5 - 0 ratings