我正在尝试打开新的 Calc 文档,但出现此错误:
System.IO.FileLoadException:混合模式程序集是针对运行时版本“v2.0.50727”构建的,如果没有其他配置信息,则无法在 4.0 运行时中加载。
Cli 引用包含在项目中。
void OpenSpreadsheetClick(object sender, EventArgs e)
{
XComponentContext oStrap = uno.util.Bootstrap.bootstrap();
//The next step is to use OpenOffice.org's service manager to create a desktop:
XMultiServiceFactory oServMan = (XMultiServiceFactory) oStrap.getServiceManager();
XComponentLoader oDesk = (XComponentLoader) oServMan.createInstance("com.sun.star.frame.Desktop" );
string url = @"private:factory/scalc";
PropertyValue[] propVals = new PropertyValue[0];
XComponent oDoc = oDesk.loadComponentFromURL(url, "_blank", 0, propVals);
}
如何解决?Tnx 寻求帮助 :)