Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/powerbi/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
.net core Azure分析服务表格模型连接到Power BI服务。NetCore数据库。模型为空异常_.net Core_Powerbi_Ssas Tabular_Adomd.net_Azure Function Async - Fatal编程技术网

.net core Azure分析服务表格模型连接到Power BI服务。NetCore数据库。模型为空异常

.net core Azure分析服务表格模型连接到Power BI服务。NetCore数据库。模型为空异常,.net-core,powerbi,ssas-tabular,adomd.net,azure-function-async,.net Core,Powerbi,Ssas Tabular,Adomd.net,Azure Function Async,在Azure函数中,我已连接到power bi服务,并且可以使用FindByName或GetByName获取数据集,但数据库.Model值为null。 这意味着我无法刷新数据集或更新任何内容 调试时,可以看到工作区中的所有数据集。 感谢您的帮助。谢谢 using (Server as_server = new Microsoft.AnalysisServices.Tabular.Server()) { as_server.Connect(connectionString); Mi

在Azure函数中,我已连接到power bi服务,并且可以使用FindByName或GetByName获取数据集,但数据库.Model值为null。 这意味着我无法刷新数据集或更新任何内容

调试时,可以看到工作区中的所有数据集。 感谢您的帮助。谢谢

using (Server as_server = new Microsoft.AnalysisServices.Tabular.Server())
{
    as_server.Connect(connectionString);
    Microsoft.AnalysisServices.Tabular.Database db = as_server.Databases.FindByName(database);
    Model m = db.Model;
    //my model m is allways null pointless to go on
}
我正在使用Microsoft.AnalysisServices.AdomdClient.NetCore.retail.amd64 19.9.0.1-Preview和
Microsoft.AnalysisServices.NetCore.retail.amd64 19.9.0.1-Preview

好的,我也有过尝试在.net core中实现此功能的痛苦,虽然没有什么文档,但我不知道为什么下面的代码可以工作,但下面是获取表格模型的代码

using (Microsoft.AnalysisServices.Server server = new Microsoft.AnalysisServices.Server())
{
    server.Connect(connectionString);  
    Microsoft.AnalysisServices.Database database = server.Databases.GetByName("adventureworks");
    Microsoft.AnalysisServices.Tabular.Model  model = database.Model as Microsoft.AnalysisServices.Tabular.Model;
}
请注意,
database.Model
在您检查它时,如果您像
database.Model.Tables
您获得的对象引用未设置为database.Model.get的对象实例


然而,如果你投下它,就像我在最后一行代码中所做的那样,突然间是作品

我没想到这会起作用,但令人震惊的是它确实起了作用。我也在使用这些库的.NETFramework版本。