- System.Exception:“组件不具有由 URI识别的资源。”
- The component does not have a resource identified by the URI
新建如下代码遇到的问题,代码中使用cs-script加载脚本后,启动窗口失败。
代码语言:javascript复制 public partial class MainWindow : Window
{
public static string csscript = @"
using WpfApp2;
class ScriptCondition
{
}
";
public MainWindow()
{
InitializeComponent();
Loaded = MainWindow_Loaded;
}
private void MainWindow_Loaded(object sender, RoutedEventArgs e)
{
CSScript.RoslynEvaluator.LoadCode(csscript);
new MainWindow().ShowDialog();
}
}
后面在github上面试了下cs-script的demo,发现loadcode会出现类似的问题,后面改用dotnet script解决了该问题