【发布时间】:2021-05-16 10:46:19
【问题描述】:
我想根据下面的链接从我的 asp.netcore 项目 (.net 5) 连接到我的本地表格服务器 https://docs.microsoft.com/en-us/analysis-services/tom/connect-to-existing-analysis-services-tabular-server-and-database?view=asallproducts-allversions
string ConnectionString = "DataSource=localhost";
using var server = new Server();
server.Connect(ConnectionString);
Console.WriteLine("Connection established successfully.");
Console.WriteLine();
Console.ForegroundColor = ConsoleColor.Yellow;
Console.WriteLine("Server name:\t\t{0}", server.Name);
Console.WriteLine("Server product name:\t{0}", server.ProductName);
Console.WriteLine("Server product level:\t{0}", server.ProductLevel);
Console.WriteLine("Server version:\t\t{0}", server.Version);
Console.ResetColor();
Console.WriteLine();
Console.WriteLine("Press Enter to close this console window.");
return Ok();
我在调用操作时收到此错误:
System.TypeLoadException: Could not load type System.Security.Principal.WindowsImpersonationContext from assembly mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089.
at Microsoft.AnalysisServices.IdentityResolver.Dispose()
at Microsoft.AnalysisServices.XmlaClient.Connect(ConnectionInfo connectionInfo, Boolean beginSession)
at Microsoft.AnalysisServices.XmlaClient.Connect(String connectionString, Boolean beginSession)
at Microsoft.AnalysisServices.Core.Server.Connect(String connectionString, String sessionId, ObjectExpansion expansionType)
at Microsoft.AnalysisServices.Core.Server.Connect(String connectionString, String sessionId)
at Microsoft.AnalysisServices.Core.Server.Connect(String connectionString)
【问题讨论】:
标签: c# .net ssas .net-5 tabular