首页 > 编程语言 >Deploying RDLC files in local mode for ASP.NET applications

Deploying RDLC files in local mode for ASP.NET applications

时间:2023-11-16 14:00:50浏览次数:31  
标签:files web ASP RDLC local server file my

Ran into problems trying to deploy my first web application to use a SQL Server Reporting Services report. I created a RDLC file and bound my report viewer control to an object data source. Worked fine on my local machine but as often happens stopped working when I tried it on dev server. First I had to install the Report Viewer Redistributable on the web server. Free download from Microsoft and painless to install. For my reports, I'm running them in local mode. When publishing to a server, I always make sure not to check the "make this web site update-able" option. When I checked the server after publishing, I found my RDLC was just 1KB pointer file as it had been compiled into a DLL and placed in my app's bin directory. Looked for a way to make it publish out as "content" rather than be compiled but couldn't find it. Then it occurred to me to check the web.config file. Sure enough, the answer lied there:

<buildProviders>

<add extension=".rdlc" type="Microsoft.Reporting.RdlBuildProvider, Microsoft.ReportViewer.Common, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />

</buildProviders>

As you can infer from the above, this tells the compiler to compile any RDLC files. I removed this from my web.config and then published again. This time the whole XML for the RDLC file was deployed out to the server as content and the report works as intended. My guess is that this code was added when I dragged the Report Viewer control onto my web page.

--------------------------

Eventually realised you can set the properties for each item in the solution explorer, and set each rdlc file's "Build Action" property to Content, and the "Copy to Output Directory" property to Copy Always.

--------------------------

Try adding the following to you web.config file in between the <compilation> tags:
            <buildProviders>
                <remove extension=".rdlc"/>
                <add extension=".rdlc" type="System.Web.Compilation.ForceCopyBuildProvider"/>
            </buildProviders>
I was having a similar problem with a different file type and this corrected the issue.
JFP

In VS 2008, .rdlc files by default have the "Build Action" in their properties as Embedded Resource. Go into the file's properties and change the Build Action to be Content, and it'll publish the file.

--------------------------

https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=372702&wa=wsignin1.0

http://weblogs.asp.net/stephensonger/archive/2008/09/10/deploying-rdlc-files-in-local-mode-for-asp-net-applications.aspx



标签:files,web,ASP,RDLC,local,server,file,my
From: https://blog.51cto.com/emanlee/8419063

相关文章

  • 快速入门:构建您的第一个 .NET Aspire 应用程序
    前言云原生应用程序通常需要连接到各种服务,例如数据库、存储和缓存解决方案、消息传递提供商或其他Web服务。.NETAspire旨在简化这些类型服务之间的连接和配置。在本快速入门中,您将了解如何创建.NETAspireStarter应用程序模板解决方案。准备条件要使用.NETAspire,您需......
  • ASP.Net MVC使用特性路由
    ASP.NETMVC中使用特性路由需要在默认路由前调用routes.MapMvcAttributeRoutes();需要注意Action上使用特性路由时需要注意不能以/开头不能写成/Controller/Action如果使用了routes.MapMvcAttributeRoutes();出现不能调用控制器“xx”上的操作方法“xx”,因为该方法是一种泛......
  • mkfs.xfs报错 mkfs.xfs: /dev/new/new_box appears to contain an existing fil
    在设置逻辑卷文件类型时候报错mkfs.xfs:/dev/new/new_boxappearstocontainanexistingfilesystem(ext4).mkfs.xfs:Usethe-foptiontoforceoverwrite.上面是说目标分区,已经存在一个文件系统但是我们有很需要他更改文件系统的话就加一个-f选项[root@server~]......
  • 持续集成指南:GitHubAction 自动构建+部署AspNetCore项目
    前言之前研究了使用GitHubAction自动构建和发布nuget包:开发现代化的.NetCore控制台程序:(4)使用GithubAction自动构建以及发布nuget包现在更进一步,使用GitHubAction在其提供的runner里构建docker镜像,之后提交到阿里云镜像私有仓库,再在本地的runner将镜像pull下来......
  • [938] How to operate with shapefiles using Geopandas
    GeopandasisaPythonlibrarythatmakesworkingwithgeospatialdataeasierbyextendingthedatamanipulationcapabilitiesofpandastospatialdata.Here'sabriefoverviewofhowtooperatewithshapefilesusingGeopandas:Installation:Makesure......
  • ASP.NET MVC解决方案的搭建(.NET Framework)——C#系列(一)
    原文链接:https://blog.csdn.net/qq_42700766/article/details/128726050一、新建项目1、控制器新建     2、Service层新建    3、Business数据层新建 4、Commons公共层新建 5、Models实体层新建 ......
  • frps: 2023/11/15 10:49:24 http: Accept error: accept tcp [::]:7650: accept4: too
    0.错误信息表明frps服务在接受传入连接时遇到了问题,特别是与端口7750相关的错误,具体错误为"accepttcp[::]:7750:accept4:toomanyopenfiles",意味着打开文件数目过多。这种错误通常发生在系统达到文件描述符的打开数目限制时。在类Unix操作系统中,每个进程都有同时可以......
  • ASP.net MVC3 报错"未找到视图“Index”或其母版视图,或没有视图引擎支持搜索的位置 "
    https://www.cnblogs.com/allenhua/p/3746578.html注意添加MVC3视图不能直接在View文件下新建视图,而是在控制器的Index右击添加视图,就会在View下面产生一个Product文件夹(包含Index.cshtml)就可以解决这个问题。具体如图:  ......
  • 图解ASP.NET MVC项目运行
    原文链接:https://jingyan.baidu.com/article/90bc8fc8ac2e52f653640c33.html吾终日所思也,不如须臾之所学也,刚开始看mvc架构,与以前的winform完全不一样,一头雾水,看完此内容豁然开朗。1、Global.asax—应用程序启动注册路由当对网站发出请求时,应用程序是如何把请求引到对应的控制......
  • 传递参数或查询字符串给_Layout.cshtml中的顶部导航在ASP.NET中的实现方式
    在ASP.NET中,你可以通过多种方式将参数或查询字符串传递给_Layout.cshtml中的顶部导航。以下是两种常见的方法:1.使用ViewBag:ViewBag是ASP.NETMVC框架中的一个特性,它允许你在视图和控制器之间传递数据。你可以在控制器中设置ViewBag的值,然后在_Layout.cshtml中使用这些值。示例代码......