Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Question
Monday, March 30, 2020 9:55 AM
I get the following error when i try to use the Report Viewer.
System.InvalidOperationException
** HResult=0x80131509**
** Message=An error occurred creating the form. See Exception.InnerException for details. The error is: Could not load file or assembly 'Microsoft.ReportViewer.Common, Version=15.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)**
** Source=RMS**
** StackTrace:**
** at RestaurantManagementSystem.My.MyProject.MyForms.Create__Instance__[T](T Instance) in :line 190**
** at RestaurantManagementSystem.My.MyProject.MyForms.get_Form4()**
** at RestaurantManagementSystem.My.MyApplication.OnCreateMainForm() in C:\Users\Lorenzo\source\repos\RestaurantManagementSystem\My Project\Application.Designer.vb:line 35**
** at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()**
** at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()**
** at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)**
** at RestaurantManagementSystem.My.MyApplication.Main(String[] Args) in :line 81**
Inner Exception 1:
FileLoadException: Could not load file or assembly 'Microsoft.ReportViewer.Common, Version=15.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
Inner Exception 2:
FileLoadException: Could not load file or assembly 'Microsoft.ReportViewer.Common, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
I am using the following VS version.
I have also included the following references accordingly to my project.
I am able to drag and drop the Report Viewer to my form and able to view it as shown below by adding references from '..\packages\Microsoft.ReportViewer.2015.12.0.2.2403\lib\net40'
But when i run the project it shows the error 'Could not load file or assembly 'Microsoft.ReportViewer.Common, Version=15.0.0.0' as shown below.
Please advise on what could possibly be wrong here?
Thank you.
VB.NET Programmer
All replies (5)
Friday, April 3, 2020 5:36 AM ✅Answered
Thank you for the suggestion. But i manage to solve it this way,
1) I removed all report viewer .dll related from the 'References' section.
2) Uninstalled all report viewer related that i downloaded from 'NuGet Package Manager'
3) Install 'Microsoft.ReportViewer.2015' and 'Microsoft.SQlServer.Types' from 'NuGet Package Manager' again.
4) Added the Report Viewer namespace & assembly in '.NET Framework Components' section from **'...\packages\Microsoft.ReportViewer.2015.12.0.2.2403\lib\net40'** as below
5) Drag and drop the Report Viewer component that was added just now and it will show as below
At first the Report Viewer component did not show as above, i had to first add another reference: 'Microsoft.ReportViewer.Design' as shown below manually from 'References' section.
I manage to get the report viewer working this way, hopefully there is no other issue.
Tuesday, March 31, 2020 5:56 AM | 1 vote
Hi lorenzolowrince,
Welcome to MSDN forum.
Refer to the information you provided, I suppose you need to update the package ‘Microsoft.ReportViewer.Common’ to the version 15.0.0.0. Please run the following command line using the Tools > NuGet Package Manage > Package Manager Console:
Install-Package Microsoft.ReportingServices.ReportViewerControl.WebForms
For more details, please refer to the guide.
Hope it helps and any feedback will be expected.
Best Regards,
Anna
MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact [email protected]
Thursday, April 2, 2020 9:53 AM
Hi lorenzolowrince,
Sorry to disturb you.
Is my suggestion helpful for you?
Have a nice day.
Sincerely,
Anna
MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact [email protected]
Friday, April 3, 2020 5:47 AM
Sorry for the late feedback and thank you for the suggestion.
Friday, April 3, 2020 5:51 AM
Hi lorenzolowrince,
Thanks for your sharing and that will help other community members who have same or similar issue.
If there is anything else we can do for you, please feel free to post in this forum.
Have a nice day.
Sincerely,
Anna
MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact [email protected]