Azure-docs: Missing using statement

Created on 13 Dec 2019  Â·  3Comments  Â·  Source: MicrosoftDocs/azure-docs

The C# example for output binding fails with:
2019-12-13T19:49:57.665 [Error] run.csx(10,76): error CS0246: The type or namespace name 'Blob' could not be found (are you missing a using directive or an assembly reference?)


Document Details

⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Pri1 azure-functionsvc cxp doc-bug triaged

All 3 comments

This is the complete output with all the errors that the C# example spits out:


2019-12-13T20:36:21  Welcome, you are now connected to log-streaming service. The default timeout is 2 hours. Change the timeout with the App Setting SCM_LOGSTREAM_TIMEOUT (in seconds). 

2019-12-13T20:36:33.048 [Information] Executing 'Functions.BlobTriggerImageResize' (Reason='This function was programmatically called via the host APIs.', Id=41605cbd-1a23-4bfb-9cc5-24c3d62b2ecf)
2019-12-13T20:36:33.103 [Error] Function compilation error

Microsoft.CodeAnalysis.Scripting.CompilationErrorException : Script compilation failed.

   at async Microsoft.Azure.WebJobs.Script.Description.DotNetFunctionInvoker.CreateFunctionTarget(CancellationToken cancellationToken) at C:\azure-webjobs-sdk-script\src\WebJobs.Script\Description\DotNet\DotNetFunctionInvoker.cs : 314

   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

   at async Microsoft.Azure.WebJobs.Script.Description.FunctionLoader`1.GetFunctionTargetAsync[T](Int32 attemptCount) at C:\azure-webjobs-sdk-script\src\WebJobs.Script\Description\FunctionLoader.cs : 55

   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

   at async Microsoft.Azure.WebJobs.Script.Description.DotNetFunctionInvoker.GetFunctionTargetAsync(Boolean isInvocation) at C:\azure-webjobs-sdk-script\src\WebJobs.Script\Description\DotNet\DotNetFunctionInvoker.cs : 183
2019-12-13T20:36:33.169 [Error] run.csx(4,7): error CS0246: The type or namespace name 'SixLabors' could not be found (are you missing a using directive or an assembly reference?)
2019-12-13T20:36:33.252 [Error] run.csx(5,7): error CS0246: The type or namespace name 'SixLabors' could not be found (are you missing a using directive or an assembly reference?)
2019-12-13T20:36:33.341 [Error] run.csx(6,7): error CS0246: The type or namespace name 'SixLabors' could not be found (are you missing a using directive or an assembly reference?)
2019-12-13T20:36:33.470 [Error] run.csx(7,7): error CS0246: The type or namespace name 'SixLabors' could not be found (are you missing a using directive or an assembly reference?)
2019-12-13T20:36:33.623 [Error] run.csx(29,32): error CS0246: The type or namespace name 'Image<>' could not be found (are you missing a using directive or an assembly reference?)
2019-12-13T20:36:33.697 [Error] run.csx(29,38): error CS0246: The type or namespace name 'Rgba32' could not be found (are you missing a using directive or an assembly reference?)
2019-12-13T20:36:33.835 [Error] run.csx(29,84): error CS0246: The type or namespace name 'IImageFormat' could not be found (are you missing a using directive or an assembly reference?)
2019-12-13T20:36:33.895 [Error] run.csx(11,6): error CS0246: The type or namespace name 'BlobTriggerAttribute' could not be found (are you missing a using directive or an assembly reference?)
2019-12-13T20:36:33.990 [Error] run.csx(11,6): error CS0246: The type or namespace name 'BlobTrigger' could not be found (are you missing a using directive or an assembly reference?)
2019-12-13T20:36:34.048 [Error] run.csx(12,6): error CS0246: The type or namespace name 'BlobAttribute' could not be found (are you missing a using directive or an assembly reference?)
2019-12-13T20:36:34.181 [Error] run.csx(12,6): error CS0246: The type or namespace name 'Blob' could not be found (are you missing a using directive or an assembly reference?)
2019-12-13T20:36:34.253 [Error] run.csx(13,6): error CS0246: The type or namespace name 'BlobAttribute' could not be found (are you missing a using directive or an assembly reference?)
2019-12-13T20:36:34.306 [Error] run.csx(13,6): error CS0246: The type or namespace name 'Blob' could not be found (are you missing a using directive or an assembly reference?)
2019-12-13T20:36:34.367 [Error] run.csx(15,5): error CS0246: The type or namespace name 'IImageFormat' could not be found (are you missing a using directive or an assembly reference?)
2019-12-13T20:36:34.437 [Error] run.csx(17,12): error CS0246: The type or namespace name 'Image<>' could not be found (are you missing a using directive or an assembly reference?)
2019-12-13T20:36:34.538 [Error] run.csx(17,18): error CS0246: The type or namespace name 'Rgba32' could not be found (are you missing a using directive or an assembly reference?)
2019-12-13T20:36:34.603 [Error] run.csx(17,34): error CS0103: The name 'Image' does not exist in the current context
2019-12-13T20:36:34.661 [Error] run.csx(23,12): error CS0246: The type or namespace name 'Image<>' could not be found (are you missing a using directive or an assembly reference?)
2019-12-13T20:36:34.754 [Error] run.csx(23,18): error CS0246: The type or namespace name 'Rgba32' could not be found (are you missing a using directive or an assembly reference?)
2019-12-13T20:36:34.849 [Error] run.csx(23,34): error CS0103: The name 'Image' does not exist in the current context
2019-12-13T20:36:34.947 [Error] Executed 'Functions.BlobTriggerImageResize' (Failed, Id=41605cbd-1a23-4bfb-9cc5-24c3d62b2ecf)

Script compilation failed.

Also, the exampes for the C# and C# scripts are comletely different. The documentation not only doesn't describe how to create the output binding but adds a lot of confusion.

@toddysm
Thanks for your feedback! We will investigate and update as appropriate.

@toddysm Thanks for reporting this issue and helping us drive improvements towards MS Docs! I've updated the csharp sample demonstrating the output binding with a fix and the changes should be live shortly after the PR merge.

We will now proceed to close this thread. If there are further questions regarding this matter, please reopen it and we will gladly continue the discussion.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Favna picture Favna  Â·  3Comments

mrdfuse picture mrdfuse  Â·  3Comments

behnam89 picture behnam89  Â·  3Comments

AronT-TLV picture AronT-TLV  Â·  3Comments

monteledwards picture monteledwards  Â·  3Comments