Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Webjobs.wap.targets file causing build failure
cskardon
#1 Posted : Wednesday, January 28, 2015 3:38:10 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 11/27/2012(UTC)
Posts: 8
Location: United Kingdom

Was thanked: 1 time(s) in 1 post(s)
Hi,

I've just added a webjobs project to a solution, (via right-clicking on the web application, selecting 'add' and new webjob).

NCrunch is now failing to build the web project quoting:


Code:
..\packages\Microsoft.Web.WebJobs.Publish.1.0.2\tools\webjobs.wap.targets (52): The "ReadWebJobsConfigFile" task could not be loaded from the assembly C:\Users\Chris\AppData\Local\NCrunch\15708\29\packages\Microsoft.Web.WebJobs.Publish.1.0.2\tools\Microsoft.Web.WebJobs.Publish.Tasks.dll. Could not load file or assembly 'Microsoft.WindowsAzure.Management.Scheduler, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified. Confirm that the <UsingTask> declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask.



If I look in the 'packages\Microsoft.Web.WebJobs.Publish.1.0.2\tools\' I can see the .Tasks.dll and Microsoft.WindowsAzure.Management.Scheduler.dll, the solution itself builds fine, I've tried adding the tools folder as 'Additional files to include' in the configuration, but no joy.

Anything else I should try?

Cheers

Chris
cskardon
#2 Posted : Wednesday, January 28, 2015 4:27:56 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 11/27/2012(UTC)
Posts: 8
Location: United Kingdom

Was thanked: 1 time(s) in 1 post(s)
OK,

So I edited my csproj file and removed the reference to the targets file, saved and NCrunch was back in happy territory.
Next, I added the WebJobs project I had created as an existing WebJob to the same website project and it so far (crossed fingers) appears to be in a happy place.
Remco
#3 Posted : Wednesday, January 28, 2015 10:01:46 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,144

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
Hi Chris,

This is likely due to failed automatic resolution of the task DLL file used by the webjob.

Try including the Microsoft.Web.WebJobs.Publish.1.0.2 package directory in the project using the 'Additional files to include' project-level configuration - http://www.ncrunch.net/documentation/reference_project-configuration_additional-files-to-include.

This will ensure that the DLL is properly detected by NCrunch and copied to the workspace when it goes to build the project.
cskardon
#4 Posted : Thursday, January 29, 2015 8:56:54 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 11/27/2012(UTC)
Posts: 8
Location: United Kingdom

Was thanked: 1 time(s) in 1 post(s)
Hi Remco,

I had added the 'tools' folder of the 'Microsoft.Web.WebJobs.Publish.1.0.2' package - as that had all the dlls in but that didn't work.
In the root of the package is only a .nuspec file and this tools directory, would that have made a difference?

Cheers
Remco
#5 Posted : Thursday, January 29, 2015 10:39:34 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,144

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
Interesting. Does the DLL file exist in the NCrunch workspace? An easy way to check this is to right click on the failing build, then choose Advanced->Browse to workspace, and see if the file exists on the path its expected.

I don't think the .nuspec file will make any difference in this. You are correct in your understanding that the key directory would be 'tools'.
jstrope
#6 Posted : Thursday, July 16, 2015 6:57:57 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 7/16/2015(UTC)
Posts: 2
Location: United States of America

Thanks: 1 times
Was thanked: 1 time(s) in 1 post(s)
Hello. I have just run into this same problem. We recently added a web job project to our solution. As soon as we added the webjobs-list.json file to the web project, NCrunch stopped being able to build it. It shows this message:

..\packages\Microsoft.Web.WebJobs.Publish.1.0.2\tools\webjobs.wap.targets (52, 5): The "ReadWebJobsConfigFile" task could not be loaded from the assembly C:\Users\[me]\AppData\Local\NCrunch\12088\15\packages\Microsoft.Web.WebJobs.Publish.1.0.2\tools\Microsoft.Web.WebJobs.Publish.Tasks.dll. Could not load file or assembly 'Microsoft.WindowsAzure.Management.Scheduler, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified. Confirm that the <UsingTask> declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask.

Using advice from above posts, I was able to confirm that x.Publish.Tasks.dll is being copied to the workspace, but its dependency x.WindowsAzure.Management.Scheduler is not.

webjobs.wap.targets has these UsingTask elements...

<UsingTask TaskName="ReadWebJobsConfigFile" AssemblyFile="Microsoft.Web.WebJobs.Publish.Tasks.dll"/>
<UsingTask TaskName="DeterminePublishedWebJobs" AssemblyFile="Microsoft.Web.WebJobs.Publish.Tasks.dll"/>
<UsingTask TaskName="GetScheduleMetadata" AssemblyFile="Microsoft.Web.WebJobs.Publish.Tasks.dll"/>


I tried adding the following to the vs.ncrunchproject, within the <ProjectConfiguration> tag, to no avail (no idea if I did it right):

<ItemGroup>
<None Include="..\packages\Microsoft.Web.WebJobs.Publish.1.0.2\tools\Microsoft.Web.WebJobs.Publish.Tasks.dll" />
<None Include="..\packages\Microsoft.Web.WebJobs.Publish.1.0.2\tools\Microsoft.WindowsAzure.Management.Scheduler.dll" />
</ItemGroup>

Any ideas?
Remco
#7 Posted : Thursday, July 16, 2015 9:30:40 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,144

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
Hi,

This is certain to be a matter of including the file in NCrunch's discovery steps. Note that the ncrunchproject file is a configuration file that isn't intended to be modified manually. The declarations you've made by hand should actually be made to the project file itself (since NCrunch interrogates this when resolving dependencies).

Another way to solve this is under the NCrunch 'Additional files to include' setting for the project. Try including the entire 'packages' directory. This will ensure ALL packages are included in the workspace, which is quite broad, but it should catch any missing files. Assuming this solves the problem, you can then exclude the packages directory and try including individual packages to see if you can get a narrower range of files to include.
1 user thanked Remco for this useful post.
jstrope on 7/17/2015(UTC)
jstrope
#8 Posted : Friday, July 17, 2015 4:47:56 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 7/16/2015(UTC)
Posts: 2
Location: United States of America

Thanks: 1 times
Was thanked: 1 time(s) in 1 post(s)
That worked. Thanks for your quick response!
1 user thanked jstrope for this useful post.
Remco on 7/17/2015(UTC)
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAF | YAF © 2003-2011, Yet Another Forum.NET
This page was generated in 0.056 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download