question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Report lots of "The type or namespace name 'Azure' does not exist in namespace 'Microsoft'" in Azure Function .csx file

See original GitHub issue

Environment 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

  1. 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.
  2. 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?) csx

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:open
  • Created 6 years ago
  • Reactions:8
  • Comments:11 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
401asfgcommented, Aug 18, 2020

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;

0reactions
ameypimpleycommented, Nov 9, 2020

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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found