Click here to Skip to main content
15,891,633 members
Please Sign up or sign in to vote.
1.24/5 (3 votes)
I installed Microsoft.Translator from Manage NuGet Packeges.

Then I used the following code.
C#
private void Form1_Load(object sender, EventArgs e)
        {
            
            Yam.Microsoft.Translator.Translator t = new Yam.Microsoft.Translator.Translator("clientId", "clientSecret", "en", "ar");

            MessageBox.Show(t.Translate("test"));
        }

But I am getting "Translator.cs not found" error.

When I click "Browse and find Translator.cs..." and start browsing,

its telling the file f:\dev\microsoft-translator\Microsoft.Translator\Translator.cs does not exists.
Posted
Updated 7-Jan-15 2:55am
v2
Comments
Sergey Alexandrovich Kryukov 7-Jan-15 10:54am    
No, this message does not tell you that this file does not exist. It tells you "Translator.cs" not found. Can you see the difference? :-)
From your question, it's hard to see how did you try to add Translator to your project, but you apparently failed to do it. You need to do it properly.
—SA
Afzaal Ahmad Zeeshan 7-Jan-15 10:56am    
Sergey, actually the main thing is that in another thread he said, assembly Yam was not found. So, I would recommend him that he should try to re include the assembly. From NuGet or manually.
Sergey Alexandrovich Kryukov 7-Jan-15 11:20am    
Did you ever see the exception showing that the source file is not found? This is something else, hard to say what...
Another question of OP (it was removed, probably automatically removed due to re-post reports) had two answers. I was apparent that OP did not know how assemblies and reference work; I think you tried to explain it. Probably, if the project and references were set up correctly, the problem would not appear.
—SA
Afzaal Ahmad Zeeshan 7-Jan-15 13:11pm    
Yes Sergey, I tried to tell him that this using just includes the methods and objects exposed by the library to the file you're using. But the actual work is done by adding the library to the project using the References tab (pop up) and checking the libraries to include. Otherwise, the using keyword is of no use.

Correct, this problem arises just because the assemblies are not correctly included before compiling the source code and then these problems cause a havoc.
Sergey Alexandrovich Kryukov 7-Jan-15 13:30pm    
:Facepalm: :-).
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900