Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 342 Vote(s) - 3.49 Average
  • 1
  • 2
  • 3
  • 4
  • 5
The target “ResolveWebJobFiles” does not exist in the project in Azure Website

#1
I have a Windows Azure project consisting of

- ASP.NET project (using NancyFX) deployed as Azure Website
- Business Logic class library
- Unit test class library
- 2 Console apps

I want those 2 console app to be deployed as Azure WebJobs with the Azure Website. So I right clikec on the ASP.NET project and chose Add | Existing project as Azure WebJob and added both console apps with the right schedule.

Everything seems fine, the 2 console apps now contain a JSON with schedule and the ASP.NET project contains a JSON with WebJobs definition. All the project build just fine.

The problem is, when I try to deploy the ASP.NET project to Azure, I get

The target “ResolveWebJobFiles” does not exist in the project

I found [this article][1] when the author solved this problem by adding

<Import Project="..\packages\Microsoft.Web.WebJobs.Publish.1.0.2\tools\webjobs.targets" Condition="Exists('..\packages\Microsoft.Web.WebJobs.Publish.1.0.2\tools\webjobs.targets')" />

to his csproj file, but my csproj file for the ASP.NET project already contains this import.

Any ideas what the problem is?


[1]:

[To see links please register here]

Reply

#2
I also ran into this. After updating all packages in my solution I started to get this. The `<import />` was there but it was poiting to a different version. So check that too.
Reply

#3
even i faced this issue. I reinstalled the below package in my webjob to solve it

package id="Microsoft.Web.WebJobs.Publish" version="1.0.2"
Reply

#4
Check to see if you have this file in your webjob project Properties folder:
webjob-publish-settings.json

If not, create it with this content, changing only the webJobName (for now)


{
"$schema": "http://schemastore.org/schemas/json/webjob-publish-settings.json",
"webJobName": "MyWebJobName",
"startTime": "2014-12-09T00:00:00-08:00",
"jobRecurrenceFrequency": "Hour",
"interval": 1,
"runMode": "Scheduled",
"stopping_wait_time": 3600
}
Reply

#5
I got this error recently and found the cause to be that [WebProject]/Properties/webjobs-list.json contained a reference to an old webjob that had been deleted from the solution. Deleting the reference from the json fixed the problem.
Reply

#6
in my case it was this file, which had 1 invalid webjob associated with it, removed it and it started working

**webjobs-list.json**
Reply

#7
One primary reason could be missing "webjob-publish-settings.json" file in Properties.

Please double check this file exists and included in your project.
Reply

#8
Also worth checking is the .net version of the WebJob project vs your Web app!
Reply

#9
As stated in [the documentation](

[To see links please register here]

)
> A WebJobs-enabled project has the following items added to it:
> - The Microsoft.Web.WebJobs.Publish NuGet package.
> - A webjob-publish-settings.json file that contains deployment and scheduler settings.

it clearly says the project that needs to have a reference to `Microsoft.Web.WebJobs.Publish` Nuget package is the Webjob-enabled project application, not the web application. The web application only needs `webjobs-list.json` file.

The webjob console application also may have a `webjob-publish-settings.json` file
but only in case of non continuous jobs
Reply

#10
In Kudu (under "Advanced Tools" on your web app management page, under "Development Tools"), under "Debug console", select "Powershell", then navigate to the "site" folder, then the "repository" folder.

Enter the command "dotnet restore" at the command line, then redeploy.

Edit: Still works as of 26/01/2022.
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through