Report lots of "The type or namespace name 'Azure' does not exist in namespace 'Microsoft'" in Azure Function .csx file
See original GitHub issueEnvironment data
dotnet --info
output:
.NET Command Line Tools (2.0.2)
Product Information:
Version: 2.0.2
Commit SHA-1 hash: a04b4bf512
Runtime Environment:
OS Name: Windows
OS Version: 10.0.16299
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\2.0.2\
Microsoft .NET Core Shared Framework Host
Version : 2.0.0 Build : e8b8861ac7faf042c87a5c2f9f2d04c98b69f28d
VS Code version:
C# Extension version: 1.13.1
Steps to reproduce
- Follow the steps in https://docs.microsoft.com/en-us/azure/iot-edge/tutorial-deploy-function#create-a-function-project to create a .csx azure function.
- Lots of errors like the following shown in problem tab 'The type or namespace name ‘Newtonsoft’ could not be found (are you missing a using directive or an assembly reference?) 'The type or namespace name ‘Newtonsoft’ could not be found (are you missing a using directive or an assembly reference?)
Expected behavior
Based on https://docs.microsoft.com/en-us/azure/azure-functions/functions-reference-csharp#referencing-external-assemblies These references are valid, so there should not be errors
Issue Analytics
- State:
- Created 6 years ago
- Reactions:8
- Comments:11 (3 by maintainers)
Top Results From Across the Web
Namespace errors when compiling C# Function in Azure ...
csx(9,17): error CS0234: The type or namespace name 'Rest' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)
Read more >The type or namespace name 'Azure' does not exist in the ...
You have the package for .NET Standard. I believe you need the package for .NET Core for UWP. Microsoft.Azure.DocumentDB.Core v 1.7.1.
Read more >Error Cs0234: The Type Or Namespace Name 'Azure' Does ...
Report lots of The type or namespace name 'Azure' does not exist in namespace 'Microsoft' in Azure Function.csx file #1959. Open. Report lots...
Read more >Azure Functions: How to add extensions to In-portal CSX script
The type or namespace name 'Data' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)
Read more >Azure Functions v 2.0 HttpTrigger with CosmosDB Client Tips
NetCore 2.0 based Azure Functions Environment with CosmosDB. ... I encounter a lot of these. ... CoreLib: Could not load file or assembly...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Was a solution ever found? I’m having the exact same problem, except with:
using Azure.Core.Pipeline; using Azure.DigitalTwins.Core; using Azure.DigitalTwins.Core.Serialization; using Azure.Identity;
My guess of the issue is that the older KeyVault package (v3) has an internal dependency on an earlier storage package version. My belief would be to update KeyVault to V4 which we are previewing alongside the Storage V12 library. Below are pointers to the libraries.
$> dotnet add package Azure.Storage.Blobs --version 12.0.0-preview.4 $> dotnet add package Azure.Storage.Blobs.Batching --version 12.0.0-preview.4 $> dotnet add package Azure.Storage.Queues --version 12.0.0-preview.4 $> dotnet add package Azure.Storage.Files --version 12.0.0-preview.4
$> dotnet add package Azure.Security.KeyVault.Secrets --version 4.0.0-preview.5 $> dotnet add package Azure.Security.KeyVault.Keys --version 4.0.0-preview.5 $> dotnet add package Azure.Security.KeyVault.Certificates --version 4.0.0-preview.5