zoukankan      html  css  js  c++  java
  • Deploying RDLC files in local mode for ASP.NET applications

    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

  • 相关阅读:
    Android学习路径(两)项目文件本身使用场景和文件演示
    A左右ndroid正在使用Uri监视数据库中的更改
    离PACKET_INp获取信息acket data
    curl 命令
    POJ 3177 Redundant Paths POJ 3352 Road Construction(双连接)
    Linux 下一个 Mysql error 2002 错误解决
    图片打水印 缩放 和一个输入流的转换
    qt Qt5开发
    qt 关于Qt中MVC的介绍与使用
    qt mvc3
  • 原文地址:https://www.cnblogs.com/emanlee/p/1551687.html
Copyright © 2011-2022 走看看