所以,这是我的想法。
标题说明了一切。我似乎找不到任何有关如何远程执行SSRS报告并将其另存为PDF的指导。
我试图遵循以下文章。 在ASP.NET Core网站中使用Reporting Services(SSRS)作为参考
但是,当我将Service Reference添加到我的项目中时,某些方法似乎具有错误的签名。
例如。rsExec.LoadReportAsync(report,null);
在我的参考资料中,第一个参数是TrustedUserHeader对象。
有没有人有一个很好的起点,说明如何从C#执行SSRS报告?我找不到任何简单的例子。
我正在创建一个准系统.NET Core web api项目(从下面的空白模板开始) https://andrewlock.net/removing-the-mvc-razor-dependencies-from-the-web-api-template-in-asp-网核心/
下面的代码工作正常,直到我添加了Swashbuckle.AspNetCore(以及下面的配置代码),现在我们得到这个错误
InvalidOperationException:没有注册类型为"Microsoft.AspNetCore.Mvc.ApiExplorer.IApiDescriptionGroupCollectionProvider"的服务.
有任何想法吗?
请注意:我们没有使用"builder.AppMvc()",因为我们正在尝试尽可能减少这个API.
public class Startup
{
// This method gets called by the runtime. Use this method to add services to the container.
// For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940
public void ConfigureServices(IServiceCollection services)
{
var builder = services.AddMvcCore();
builder.AddAuthorization();
builder.AddFormatterMappings();
builder.AddJsonFormatters();
builder.AddCors();
// Register the Swagger generator, defining one or more Swagger documents
services.AddSwaggerGen(c =>
{
c.SwaggerDoc("v1", new Info { Title = "My API", Version = "v1" …Run Code Online (Sandbox Code Playgroud) 我正在创建一个准系统.NET Core web api项目(从下面的空白模板开始)https://andrewlock.net/removing-the-mvc-razor-dependencies-from-the-web-api-template-in-asp-网核心/
下面的代码工作正常,直到我添加了StructureMap.现在,我收到了这个错误.
StructureMap.StructureMapConfigurationException:没有注册默认实例,无法自动确定类型'System.IServiceProvider'
没有为System.IServiceProvider指定配置
1.)Container.GetInstance()
在StructureMap.SessionCache.GetDefault(Type pluginType,IPipelineGraph pipelineGraph),位于WebApplication4.Startup.ConfigureServices(IServiceCollection服务)上的StructureMap.Container.GetInstanceT ---从抛出异常的上一个位置开始的堆栈跟踪---在System.Runtime Microsoft.AspNetCore.Hosting.Internal.WebHost.BuildApplication()中的Microsoft.AspNetCore.Hosting.Internal.WebHost.EnsureApplicationServices()中的Microsoft.AspNetCore.Hosting.ConventionBasedStartup.ConfigureServices(IServiceCollection services)上的.ExceptionServices.ExceptionDispatchInfo.Throw()
有任何想法吗?
请注意:我们没有使用,builder.AppMvc()因为我们正试图尽可能减少这个api.
这是相关的代码.
public IServiceProvider ConfigureServices(IServiceCollection services)
{
var builder = services.AddMvcCore();
builder.AddApiExplorer();
builder.AddAuthorization();
builder.AddFormatterMappings();
builder.AddJsonFormatters();
builder.AddCors();
// Register the Swagger generator, defining one or more Swagger documents
services.AddSwaggerGen(c =>
{
c.SwaggerDoc("v1", new Info { Title = "My API", Version = "v1" });
});
var container = ContainerConfigurator.Configure();
return container.GetInstance<IServiceProvider>();
}
// This method gets called by the runtime. Use this method to …Run Code Online (Sandbox Code Playgroud)