• 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

  • 相关阅读:
    PHP 生成二维码底部拼接文字和中间拼接logo
    牛客练习赛85
    Codeforces Round #729 (Div. 2)
    Codeforces Round #727 (Div. 2)
    AtCoder Beginner Contest 206(Sponsored by Panasonic)
    Codeforces Round #726 (Div. 2)
    Codeforces Round #722 (Div. 2)
    Codeforces Round #721 (Div. 2)
    AtCoder Regular Contest 118
    牛客练习赛82
  • 原文地址:https://www.cnblogs.com/emanlee/p/1551687.html
Copyright © 2020-2023  润新知