Azure函数中的ReportViewer:mscorlib:路径不是合法形式 [英] ReportViewer in Azure Functions: mscorlib: The path is not of a legal form

查看:67
本文介绍了Azure函数中的ReportViewer:mscorlib:路径不是合法形式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是第一次将简单的ASP Web API迁移到Azure Functions.该函数将接受一些JSON输入,并使用Microsoft.Reporting.WebForms创建一个PDF报告.

I'm migrating simple ASP Web API to Azure Functions, for the first time. The function will take some JSON input, and creates a PDF report with Microsoft.Reporting.WebForms.

不幸的是,我收到以下错误:

Unfortunatly, I get the following error:

执行函数:Functions.HttpTriggerCSharp1时发生异常. Microsoft.ReportViewer.WebForms:本地报表处理期间发生错误. Microsoft.ReportViewer.Common:的定义 报告'D:\ home \ site \ wwwroot \ HttpTriggerCSharp1 \ bin \ Test.rdlc'无效. Microsoft.ReportViewer.Common:报表处理中发生意外错误. Microsoft.ReportViewer.Common:"Microsoft.ReportingServices.ReportIntermediateFormat.Persistence.IntermediateFormatVersion"的类型初始值设定项 引发了异常. mscorlib:路径不是合法形式.

Exception while executing function: Functions.HttpTriggerCSharp1. Microsoft.ReportViewer.WebForms: An error occurred during local report processing. Microsoft.ReportViewer.Common: The definition of the report 'D:\home\site\wwwroot\HttpTriggerCSharp1\bin\Test.rdlc' is invalid. Microsoft.ReportViewer.Common: An unexpected error occurred in Report Processing. Microsoft.ReportViewer.Common: The type initializer for 'Microsoft.ReportingServices.ReportIntermediateFormat.Persistence.IntermediateFormatVersion' threw an exception. mscorlib: The path is not of a legal form.

首先,我认为没有找到.rdlc文件,但事实并非如此.它可以找到文件,但无法处理它,看来如此.

First I thought that the .rdlc file was not found, but that doens't seems to be the case. It finds the file, but can't handle it, so it seems.

我通过以下方式调用文件:

I'm calling the file via:

ReportViewer rv = new ReportViewer();
rv.ProcessingMode = ProcessingMode.Local;
rv.LocalReport.ReportPath = Path.Combine(System.Environment.GetEnvironmentVariable("HOME"), @"site\wwwroot\HttpTriggerCSharp1\bin\Test.rdlc");

我进行了很多搜索,但是找不到有关Azure Functions和ReportViewer的详细信息.也许我错过了一些东西,或者我正在尝试一些不可能的事情.预先感谢.

I've searched a lot, but can't find specifics on Azure Functions and ReportViewer. Maybe I'm missing something, or I'm trying something that's not possible. Thanks in advance.

我的函数可以使用Visual Studio和功能工具完美地脱机工作.

my function works perfectly offline, using Visual Studio, and the Function Tools.

推荐答案

我猜想您已经向project.json添加了一些软件包才能使其正常工作?您介意共享那个project.json以及您的代码吗?我想尝试重现它,因此代码可能很少-我主要是想看看#r并使用语句. 
I'm guessing you've added some packages to project.json to get this to work? Would you mind sharing that project.json as well as your code? I'd like to try to reproduce it, so the code can be minimal -- I mostly want to see #r and using statements. 


这篇关于Azure函数中的ReportViewer:mscorlib:路径不是合法形式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆