using System;
using System.Speech.Synthesis;
using System.IO;
namespace NamespaceName
{
public class ClassName
{
public static void Main(string[] args)
{
string path;
SpeechSynthesizer synth = new SpeechSynthesizer();
synth.SetOutputToDefaultAudioDevice();
synth.SelectVoice("Microsoft Paulina Desktop");
Console.WriteLine("Podaj sciezke do pliku ktory chcesz wczytac");
path = Console.ReadLine();
try
{
using(StreamReader sr = new StreamReader(path)){
string line;
while((line = sr.ReadLine()) != null){
synth.Speak(line);
}
}
}
catch(Exception e)
{
Console.WriteLine("The file could not be read");
Console.WriteLine(e.Message);
}
System.ReadKey()
}
}
}
Gdy próbuję skompilować ten kod poleceniem
csc /r:System.Speech.dll CzytajPlik.cs otrzymuję błąd
error CS0006: Nie można odnaleźć pliku metadanych „System.Speech.dll”.
O co chodzi z tym plikiem metadanych i jak to naprawić