After upgrading Microsoft Report Viewer Control for ASP.Net Web Forms applications from version 10 to 15 with Nuget, when published project to server the error below starts to appear. On local machine everything works fine. All ReportViewer reference Copy
Local properties are set to True, registered all report pages with appropriate assembly. Tried clearing temp asp.net files, checked for double references in web.config, installed latest version of report viewer on server, nothing helped. Do you have any advice
or faced similar issue?
Compilation Error Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: CS0433: The type 'Microsoft.Reporting.WebForms.ReportDataSource' exists in both 'c:\Windows\assembly\GAC_MSIL\Microsoft.ReportViewer.WebForms\10.0.0.0__b03f5f7f11d50a3a\Microsoft.ReportViewer.WebForms.dll' and 'c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary
ASP.NET Files\psshifttracker\3204b50c\1eca333e\assembly\dl3\0941aa88\00019b61_9c4ed401\Microsoft.ReportViewer.WebForms.DLL'
Source Error:
Line 595:
Line 596: [System.Diagnostics.DebuggerNonUserCodeAttribute()]
Line 597: private global::Microsoft.Reporting.WebForms.ReportDataSource @__BuildControl__control9() {
Line 598: global::Microsoft.Reporting.WebForms.ReportDataSource @__ctrl;
Line 599:
Source File: c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\psshifttracker\3204b50c\1eca333e\App_Web_shiftreport.aspx.dfa151d5.venwfp5b.0.cs
Line: 597
.NET forums are moving to a new home on Microsoft Q&A, we encourage you to go to Microsoft Q&A for .NET for posting new questions and get involved today.
.NET forums are moving to a new home on Microsoft Q&A, we encourage you to go to Microsoft Q&A for .NET for posting new questions and get involved today.
Turns out it is using some DLLs from master application which is using version 10. Reports are in sub application in IIS, when moving the application one level higher reports work fine with the new version. Trying to find a way to make applications independent
from the master application, so I could avoid upgrading version of master at the moment ...
I'm glad that you have solved your issue, I suggest you could mark the answer which is right and helpful. This will help other people who faces the same issue to find the right answer more faster.
Thanks,
Brando
.NET forums are moving to a new home on Microsoft Q&A, we encourage you to go to Microsoft Q&A for .NET for posting new questions and get involved today.
None
0 Points
3 Posts
CS0433: The type Microsoft.Reporting.WebForms.ReportDataSource exists in both GAC and Temporary A...
Dec 20, 2018 08:34 AM|seftero|LINK
After upgrading Microsoft Report Viewer Control for ASP.Net Web Forms applications from version 10 to 15 with Nuget, when published project to server the error below starts to appear. On local machine everything works fine. All ReportViewer reference Copy Local properties are set to True, registered all report pages with appropriate assembly. Tried clearing temp asp.net files, checked for double references in web.config, installed latest version of report viewer on server, nothing helped. Do you have any advice or faced similar issue?
----------------------------------------------------------------------------------------------------------------
Compilation Error Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately. Compiler Error Message: CS0433: The type 'Microsoft.Reporting.WebForms.ReportDataSource' exists in both 'c:\Windows\assembly\GAC_MSIL\Microsoft.ReportViewer.WebForms\10.0.0.0__b03f5f7f11d50a3a\Microsoft.ReportViewer.WebForms.dll' and 'c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\psshifttracker\3204b50c\1eca333e\assembly\dl3\0941aa88\00019b61_9c4ed401\Microsoft.ReportViewer.WebForms.DLL' Source Error:
Line 595:
Line 596: [System.Diagnostics.DebuggerNonUserCodeAttribute()]
Line 597: private global::Microsoft.Reporting.WebForms.ReportDataSource @__BuildControl__control9() {
Line 598: global::Microsoft.Reporting.WebForms.ReportDataSource @__ctrl;
Line 599:
Source File: c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\psshifttracker\3204b50c\1eca333e\App_Web_shiftreport.aspx.dfa151d5.venwfp5b.0.cs Line: 597
Star
9831 Points
3120 Posts
Re: CS0433: The type Microsoft.Reporting.WebForms.ReportDataSource exists in both GAC and Tempora...
Dec 21, 2018 03:18 AM|Brando ZWZ|LINK
Hi seftero,
According to your description, it seems the GAC's assembly is not as same as the new ReportViewer version.
I suggest you could try to modify the web.config to bind redirect from 10.0.0 to 15.0,0.
More details, you could refer to below web.config.
Notice: you should modify the version according to your webforms version number.
Best Regards,
Brando
None
0 Points
3 Posts
Re: CS0433: The type Microsoft.Reporting.WebForms.ReportDataSource exists in both GAC and Tempora...
Dec 21, 2018 09:06 AM|seftero|LINK
Hi Brando,
Thanks for your answer. I've tried to redirect binding but it didn't helped. Below is the modified web.config
Regards,
seftero
Star
9831 Points
3120 Posts
Re: CS0433: The type Microsoft.Reporting.WebForms.ReportDataSource exists in both GAC and Tempora...
Dec 25, 2018 02:54 AM|Brando ZWZ|LINK
Hi seftero,
I suggest you could try below web.config setting.
Best Regards,
Brando
None
0 Points
3 Posts
Re: CS0433: The type Microsoft.Reporting.WebForms.ReportDataSource exists in both GAC and Tempora...
Dec 27, 2018 09:57 AM|seftero|LINK
Turns out it is using some DLLs from master application which is using version 10. Reports are in sub application in IIS, when moving the application one level higher reports work fine with the new version. Trying to find a way to make applications independent from the master application, so I could avoid upgrading version of master at the moment ...
Star
9831 Points
3120 Posts
Re: CS0433: The type Microsoft.Reporting.WebForms.ReportDataSource exists in both GAC and Tempora...
Jan 02, 2019 03:03 AM|Brando ZWZ|LINK
Hi seftero,
I'm glad that you have solved your issue, I suggest you could mark the answer which is right and helpful. This will help other people who faces the same issue to find the right answer more faster.
Thanks,
Brando