在尝试从 .txt 文件中编译一些代码(在运行时)时,我的代码引用了正在编译的代码的程序集。
几个月来它一直运行良好,但我最近不得不将 System.Speech.dll 添加为引用的程序集之一,现在当它尝试编译任何文本文件中的代码时出现错误。
这是错误:
找不到元数据文件“System.Speech.dll”
System.Speech.dll 也在项目的引用中,所以如果这可能是问题,它不是。此外,所有其他引用的 dll 都完全正常,完全没有错误。
这是代码部分:(如果您需要更多,请评论)
CompilerParameters options = new CompilerParameters();
options.ReferencedAssemblies.Add("System.dll");
options.ReferencedAssemblies.Add("System.Core.dll");
options.ReferencedAssemblies.Add("System.Drawing.dll");
options.ReferencedAssemblies.Add("System.Speech.dll");
我怎样才能消除这个错误?谢谢!