none
Error converting RDLC to 2008 format RRS feed

  • Question

  • I recently purchased VS 2010 Pro and upgraded my VS 2008 windows forms project.  Everything works fine including my reports which are processed locally.  I do not use SQL server for processing reports.  However, now I want to edit a report and that's where I get the error.

    When I double click the RDLC I get the following message (call it message A):

    "Do you want to convert this report to RDlC 2008 format?  Please click OK to proceed or Cancel to open it in the XML editor"

    If I click OK to message A, it converts and opens the RDLC so I can edit it.  Howver even if I do not edit anything, if I now run the report in the VS environment, I get the following error.

    "The report definition is not valid.  Details: The report definition has an invalid target namespace 'http://schemas.microsoft.com/sqlserver/reporting/2008/01/reportdefinition' which cannot be upgraded."

    So doing this conversion to 2008 format broke my report.

    If I click Cancel to message A, then I get an error:

    "The version of the report definition language (RDL) is not supported by Visual Studio 2010 Report Designer." and if I click the EDIT link it opens the xml editor, and a window opens and says "Inconsistent Line Endings.  Do you want to normalize line endings?   Line ending: Windows (CR LF)

    I believe the original RDLC was created in BIS 2005 and propably not edited since.  My project compiles with .net 2.0 but even if I compile it with .net 4.0 the same behavior described above exists.

    How do I edit my existing RDLCs without breaking them?

    Thanks,

    Joe A

    Tuesday, June 29, 2010 7:40 PM

All replies

  • Opps... one correction to my post.

    The original RDLC was created in VS 2005 (not BIS 2005)

    Sorry.

    Joe

    Tuesday, June 29, 2010 7:48 PM
  • Did you change your Report Viewer references to the 10.0 version of the Report Control? The references do not change automatically when you edit your report schema.


    Brad Syputa, Microsoft Reporting Services This posting is provided "AS IS" with no warranties.
    Thursday, July 1, 2010 9:25 PM
  • Hi Brad... thank you for your assistance.

    Yes, changing the references from 8.0.0.0 to 10.0.0.0 in MyProject/References tab seems to have fixed the rdlc's so now the reports can be viewed without error.  Thank you.

    However, this seems to have caused another problem.  Before I descibe the new problem, let me document the steps I took to fix the error caused by "converting a rdlc from VS2008 to an rdlc for VS2010.  Then I'll describe the new problem.

    1) Convert my VS 2008 project to VS2010 by opening it in VS2010.
    2) Go to MyProject/Compile tab/Advanced Compile Options button and change from .NET Framework 2.0 to .NET Framework 4.
    3) Go to MyProject/References tab and delete the 2 references "Microsoft.ReportViewer.Common" & "Microsoft.ReportViewer.WinForms" which are version 8.0.0.0.  Add 2 new refernces with the same names but version 10.0.0.0.
    4) Double click the rdlc in Solution Explorer.  It offers to convert.  Click Yes Convert.  It converts fine.

    After the above procedure the reports open fine.

    Here's the new problem.  If I launch my App and DON'T OPEN A REPORT, the app will quit when you close the startup form.  Obviously normal behavior. However, if you open a report to view it, then close the report with red x, then quit the App by clicking the red x on the startup form, the app throws the following error.  You can not quit the App if a report has been opened!  HELP!

    System.CannotUnloadAppDomainException was unhandled
      Message=Error while unloading appdomain. (Exception from HRESULT: 0x80131015)
      Source=mscorlib
      StackTrace:
           at System.AppDomain.Unload(AppDomain domain)
           at Microsoft.ReportingServices.RefCountedAppDomain.Dispose()
           at Microsoft.Reporting.WinForms.LocalReport.ReportRuntimeSetupHandler.ReleaseSandboxAppDomain()
           at Microsoft.Reporting.WinForms.LocalReport.Dispose()
           at Microsoft.Reporting.WinForms.ReportInfo.Dispose()
           at Microsoft.Reporting.WinForms.ReportHierarchy.Clear()
           at Microsoft.Reporting.WinForms.ReportViewer.Dispose(Boolean disposing)
           at System.ComponentModel.Component.Finalize()
      InnerException:

    If I add a breakpoint in the form_closing event I get the following exceptions in the immediate window:

    Step into: Stepping over non-user code 'System.Windows.Forms.Form.OnFormClosing'
    Step into: Stepping over non-user code 'System.Windows.Forms.Form.RaiseFormClosingOnAppExit'
    Step into: Stepping over non-user code 'System.Windows.Forms.Application.ExitInternal'
    Step into: Stepping over non-user code 'System.Windows.Forms.Application.Exit'
    Step into: Stepping over non-user code 'System.Windows.Forms.Form.OnFormClosing'
    Step into: Stepping over non-user code 'System.Windows.Forms.Form.WmClose'
    Step into: Stepping over non-user code 'BBLExpWinApp1.frmMainForm.Dispose'
    Step into: Stepping over non-user code 'System.ComponentModel.Component.Dispose'
    Step into: Stepping over non-user code 'System.Windows.Forms.Form.WndProc'
    Step into: Stepping over non-user code 'System.Windows.Forms.NativeWindow.DebuggableCallback'
    Step into: Stepping over non-user code 'System.Windows.Forms.NativeWindow.DefWndProc'
    Step into: Stepping over non-user code 'System.Windows.Forms.Form.DefWndProc'
    Step into: Stepping over non-user code 'System.Windows.Forms.Control.WndProc'
    Step into: Stepping over non-user code 'System.Windows.Forms.Form.WndProc'
    Step into: Stepping over non-user code 'System.Windows.Forms.NativeWindow.DebuggableCallback'
    Step into: Stepping over non-user code 'System.Windows.Forms.NativeWindow.DefWndProc'
    Step into: Stepping over non-user code 'System.Windows.Forms.Form.DefWndProc'
    Step into: Stepping over non-user code 'System.Windows.Forms.Control.WndProc'
    Step into: Stepping over non-user code 'System.Windows.Forms.Form.WndProc'
    Step into: Stepping over non-user code 'System.Windows.Forms.NativeWindow.DebuggableCallback'
    Step into: Stepping over non-user code 'System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop'
    Step into: Stepping over non-user code 'BBLExpWinApp1.frmSplash.Dispose'
    Step into: Stepping over non-user code 'System.ComponentModel.Component.Dispose'
    Step into: Stepping over non-user code 'System.Windows.Forms.ApplicationContext.Dispose'
    Step into: Stepping over non-user code 'System.Windows.Forms.Application.ThreadContext.DisposeThreadWindows'
    Step into: Stepping over non-user code 'System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop'
    Step into: Stepping over non-user code 'System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner'
    Step into: Stepping over non-user code 'System.Windows.Forms.Application.ThreadContext.RunMessageLoop'
    Step into: Stepping over non-user code 'Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun'
    Step into: Stepping over non-user code 'Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel'
    Step into: Stepping over non-user code 'BBLExpWinApp1.My.MySettings.AutoSaveSettings'
    Step into: Stepping over non-user code 'BBLExpWinApp1.My.MySettings.AutoSaveSettings'
    Step into: Stepping over non-user code 'BBLExpWinApp1.My.MySettingsProperty.get_Settings'
    Step into: Stepping over non-user code 'BBLExpWinApp1.My.MySettingsProperty.get_Settings'
    Step into: Stepping over non-user code 'BBLExpWinApp1.My.MySettings.AutoSaveSettings'
    Step into: Stepping over non-user code 'Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run'
    Step into: Stepping over non-user code 'System.Runtime.Hosting.ApplicationActivator.CreateInstance'
    Step into: Stepping over non-user code 'Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssemblyDebugInZone'

    I've read about the CannotUnloadAppDomainException and it seems that an App will not quit if some other thread is running.  Thus Im guessing that the converted ReportViewer leaves a thread running which prevents the App from quitting.  see http://msdn.microsoft.com/en-us/library/system.appdomain.unload(VS.80).aspx

    Any help would be appreciated.

    Joe A

    Saturday, July 3, 2010 1:45 PM
  • The workaround is to call reportViewer.LocalReport.ReleaseSandboxAppDomain() method before closing the parent form

    example:

    private void frmMyForm_FormClosing(object sender, FormClosingEventArgs e)
    {
                reportViewer1.LocalReport.ReleaseSandboxAppDomain();
            
    }

    P.S. Original post: http://connect.microsoft.com/VisualStudio/feedback/details/522208/wpf-app-with-reportviewer-gets-error-while-unloading-appdomain-exception-on-termination

    • Proposed as answer by Atervan Thursday, December 2, 2010 12:31 PM
    Saturday, July 10, 2010 2:36 PM