21

I am trying to debug a webjob on azure and I get the following error: Source Not Found, AsyncExtensions.cs not found.

I am working on VS 2015 and the webjob is part of an ASP.NET MVC solution deployed on Azure.

I had published the webjob by right-clicking on it and doing Publish as Azure webjob and selecting Debug configuration. I started debug by right-click on the webjob and selecting Debug, Start New Instance. When the execution reaches a problematic line, I get the error above instead of the error corresponding to the problematic line. This has happened on several different webjobs.

donquijote
  • 1,642
  • 5
  • 19
  • 41
  • Maybe your file is not included in the deploy....on VS 2015 on the solution explorer, click on the "Show all Files" icon...check if your file is showing, right click on it and choose "Include in Project"...then rebuild your solution and deploy it again – Hackerman Aug 26 '16 at 13:40
  • 2
    I checked and the files were included in the project – donquijote Aug 26 '16 at 15:51

3 Answers3

61

I had the same issue and it is resolved by enabling the option Enable Just My Code in Debug → Options → Debugging → General.

Nathan Tuggy
  • 2,237
  • 27
  • 30
  • 38
Praveen
  • 831
  • 7
  • 15
0

Just by chance I reproduced a similar error. See both lines below:

    // OK
LogToConsole(String.Format("Pixel format: {0} = {1}", lValue, ival));

// ERROR: AsynchMethodBuilder.cs not found exception
LogToConsole(String.Format("Pixel format: {0} = {1}" + lValue, ival));

Comparing both lines it should be obvious where the problem is. This construct sneaks under the syntax checker and the compiler error checking.

Guillermo
  • 56
  • 6
-1

Please try to use KUDU tool to check whether the files are published to Azure. Here is the path of the webjob: d:\home\site\wwwroot\app_data\jobs\continuous\{job name} or d:\home\site\wwwroot\app_data\jobs\triggered\{job name}, it depends on your webjob mode. If you could not find the cs files, please find the file in Visual Studio solution, right click and select property, then set the 'Copy to Output Directory' as 'Copy always' like the following screenshot:

enter image description here

Jambor - MSFT
  • 3,175
  • 1
  • 13
  • 16