Directory' is ambiguous, imported from the namespaces or types 'Microsoft.Graph, System.IO'

HiAll,

While performing JsonConvert, Im facing below issue.

The code was developed long back with Legacy compatibility. Now when we convert into windows, We are facing this issue.
Can anyone help me with this ?
Thanks in advance for all your time

Error message :

Compiler error(s) encountered processing expression "Directory.GetFiles(Environment.CurrentDirectory+"\Data\Output")".
Directory' is ambiguous, imported from the namespaces or types 'Microsoft.Graph, System.IO'.

Hi @Dipali_Gomes

Give a try with

System.IO.Directory.GetFiles(Environment.CurrentDirectory+"\Data\Output")

Regards!

2 Likes

Hello @Dipali_Gomes , Firstly welcome back!.

I understand your issue. I faced the same. Please check if you created ā€œJsonConvertā€ as variable. If Yes, Remove it from Variable panel. The ā€œJsonConvertā€ is a namespace and hence cant be declared in Variable panel. Also, Can you please share Xaml file on how JsonConvert is getting used for Directory.GetFiles!? (Just curious to learn)

Thanks This worked!

Actually i just realized that i had 2 issue. Let me correct the description

Issue 1 : Jason Convert issue when dealing with Windows compatability.
In here, The JsonConvert logic placed in legacy works fine. However through windows it throws error

Issue 2: Directory’ is ambiguous, imported from the namespaces or types ā€˜Microsoft.Graph, System.IO’.

@Dipali_Gomes , Ohh! we request moving on to create separate topics. So if one search for the topic, they will be able to understand the solution!.
To answer your question, on high level, i could think of based on your question
for ISSUE 1,

  1. Please check if you created Variable for ā€œJsonConvertā€. If Yes, delete that.
  2. If NO, Please share Xaml file or screenshot to understand more

for ISSUE 2, Follow @fernando_zuluaga solution i.e., Directory' is ambiguous, imported from the namespaces or types 'Microsoft.Graph, System.IO' - #2 by fernando_zuluaga

1 Like

@pavithra_pavi @fernando_zuluaga , thank you both of you. it worked.

and Noted. Moving on will create separate topics

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.