Good afternoon,
I use the VisualStudio 2015 Community on a Windows 10x64 and am encountering the following problem when running the debug of a Windows Form Application project:
System.MethodAccessException was unhandled
HResult=-2146233072
Message=Falha no método 'Microsoft.Reporting.WinForms.LocalReport..ctor()' ao tentar acessar o método 'Microsoft.ReportingServices.StandalonePreviewStore..ctor()'.
Source=Sistema
StackTrace:
em Microsoft.Reporting.WinForms.LocalReport..ctor() na C:\Projetos\VisualStudio\Sistema\Sistema\Beans\GuiaSadt.cs:linha 0
em Microsoft.Reporting.WinForms.ReportViewer.CreateLocalReport() na C:\Projetos\VisualStudio\Sistema\Sistema\Beans\GuiaSadt.cs:linha 0
em Microsoft.Reporting.WinForms.ReportViewer.Reset() na C:\Projetos\VisualStudio\Sistema\Sistema\Beans\GuiaSadt.cs:linha 0
em Microsoft.Reporting.WinForms.ReportViewer..ctor() na C:\Projetos\VisualStudio\Sistema\Sistema\Beans\GuiaSadt.cs:linha 0
em Sistema.FrmPrincipal.FrmPrincipal_Load(Object sender, EventArgs e) na C:\Projetos\VisualStudio\Sistema\Sistema\FrmPrincipal.cs:linha 181
em System.Windows.Forms.Form.OnLoad(EventArgs e)
em System.Windows.Forms.Form.OnCreateControl()
em System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
em System.Windows.Forms.Control.CreateControl()
em System.Windows.Forms.Control.WmShowWindow(Message& m)
em System.Windows.Forms.Control.WndProc(Message& m)
em System.Windows.Forms.ScrollableControl.WndProc(Message& m)
em System.Windows.Forms.Form.WmShowWindow(Message& m)
em System.Windows.Forms.Form.WndProc(Message& m)
em System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
em System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
em System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
InnerException:
I'm using the ReportViewer Control inside a Form with nothing else on it and this error happens.
Is there any missing reference or configuration in my project? Thankful.
EDIT: Where the error occurs is the following snippet:
this.reportViewer1 = new Microsoft.Reporting.WinForms.ReportViewer();