Question

powerzone3000 on Mon, 11 Sep 2017 08:24:04


Hello everyone,

I'm having some troubles with the new ReportViewer 14: I installed the ReportViewer 14 NuGet package in a Windows Forms Application targeting .NET Framwork 4.0.

When building, I'm receiving the following warnings:

1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(1987,5): warning MSB3268: The primary reference "Microsoft.ReportViewer.Design" could not be resolved because it has an indirect dependency on the framework assembly "System.Net.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" which could not be resolved in the currently targeted framework. ".NETFramework,Version=v4.0". To resolve this problem, either remove the reference "Microsoft.ReportViewer.Design" or retarget your application to a framework version which contains "System.Net.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".
1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(1987,5): warning MSB3258: The primary reference "Microsoft.ReportViewer.Design" could not be resolved because it has an indirect dependency on the .NET Framework assembly "Microsoft.Build.Framework, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" which has a higher version "14.0.0.0" than the version "4.0.0.0" in the current target framework.
1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(1987,5): warning MSB3268: The primary reference "Microsoft.ReportViewer.Design" could not be resolved because it has an indirect dependency on the framework assembly "System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" which could not be resolved in the currently targeted framework. ".NETFramework,Version=v4.0". To resolve this problem, either remove the reference "Microsoft.ReportViewer.Design" or retarget your application to a framework version which contains "System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".
1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(1987,5): warning MSB3268: The primary reference "Microsoft.ReportViewer.Design" could not be resolved because it has an indirect dependency on the framework assembly "System.Threading.Tasks, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" which could not be resolved in the currently targeted framework. ".NETFramework,Version=v4.0". To resolve this problem, either remove the reference "Microsoft.ReportViewer.Design" or retarget your application to a framework version which contains "System.Threading.Tasks, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".
1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(1987,5): warning MSB3268: The primary reference "Microsoft.ReportViewer.Design" could not be resolved because it has an indirect dependency on the framework assembly "System.Diagnostics.Tracing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" which could not be resolved in the currently targeted framework. ".NETFramework,Version=v4.0". To resolve this problem, either remove the reference "Microsoft.ReportViewer.Design" or retarget your application to a framework version which contains "System.Diagnostics.Tracing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".
1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(1987,5): warning MSB3268: The primary reference "Microsoft.ReportViewer.Design" could not be resolved because it has an indirect dependency on the framework assembly "System.Collections.Concurrent, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" which could not be resolved in the currently targeted framework. ".NETFramework,Version=v4.0". To resolve this problem, either remove the reference "Microsoft.ReportViewer.Design" or retarget your application to a framework version which contains "System.Collections.Concurrent, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".
1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(1987,5): warning MSB3268: The primary reference "Microsoft.ReportViewer.Design" could not be resolved because it has an indirect dependency on the framework assembly "System.Dynamic.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" which could not be resolved in the currently targeted framework. ".NETFramework,Version=v4.0". To resolve this problem, either remove the reference "Microsoft.ReportViewer.Design" or retarget your application to a framework version which contains "System.Dynamic.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".
1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(1987,5): warning MSB3268: The primary reference "Microsoft.ReportViewer.Design" could not be resolved because it has an indirect dependency on the framework assembly "System.Collections, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" which could not be resolved in the currently targeted framework. ".NETFramework,Version=v4.0". To resolve this problem, either remove the reference "Microsoft.ReportViewer.Design" or retarget your application to a framework version which contains "System.Collections, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".
1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(1987,5): warning MSB3268: The primary reference "Microsoft.ReportViewer.Design" could not be resolved because it has an indirect dependency on the framework assembly "System.Threading, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" which could not be resolved in the currently targeted framework. ".NETFramework,Version=v4.0". To resolve this problem, either remove the reference "Microsoft.ReportViewer.Design" or retarget your application to a framework version which contains "System.Threading, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".
1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(1987,5): warning MSB3268: The primary reference "Microsoft.ReportViewer.Design" could not be resolved because it has an indirect dependency on the framework assembly "System.Resources.ResourceManager, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" which could not be resolved in the currently targeted framework. ".NETFramework,Version=v4.0". To resolve this problem, either remove the reference "Microsoft.ReportViewer.Design" or retarget your application to a framework version which contains "System.Resources.ResourceManager, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".
1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(1987,5): warning MSB3268: The primary reference "Microsoft.ReportViewer.Design" could not be resolved because it has an indirect dependency on the framework assembly "System.Globalization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" which could not be resolved in the currently targeted framework. ".NETFramework,Version=v4.0". To resolve this problem, either remove the reference "Microsoft.ReportViewer.Design" or retarget your application to a framework version which contains "System.Globalization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".
1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(1987,5): warning MSB3268: The primary reference "Microsoft.ReportViewer.Design" could not be resolved because it has an indirect dependency on the framework assembly "System.Diagnostics.Debug, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" which could not be resolved in the currently targeted framework. ".NETFramework,Version=v4.0". To resolve this problem, either remove the reference "Microsoft.ReportViewer.Design" or retarget your application to a framework version which contains "System.Diagnostics.Debug, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".
1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(1987,5): warning MSB3268: The primary reference "Microsoft.ReportViewer.Design" could not be resolved because it has an indirect dependency on the framework assembly "System.Runtime.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" which could not be resolved in the currently targeted framework. ".NETFramework,Version=v4.0". To resolve this problem, either remove the reference "Microsoft.ReportViewer.Design" or retarget your application to a framework version which contains "System.Runtime.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".
1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(1987,5): warning MSB3268: The primary reference "Microsoft.ReportViewer.Design" could not be resolved because it has an indirect dependency on the framework assembly "System.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" which could not be resolved in the currently targeted framework. ".NETFramework,Version=v4.0". To resolve this problem, either remove the reference "Microsoft.ReportViewer.Design" or retarget your application to a framework version which contains "System.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".
1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(1987,5): warning MSB3268: The primary reference "Microsoft.ReportViewer.Design" could not be resolved because it has an indirect dependency on the framework assembly "System.Diagnostics.Tools, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" which could not be resolved in the currently targeted framework. ".NETFramework,Version=v4.0". To resolve this problem, either remove the reference "Microsoft.ReportViewer.Design" or retarget your application to a framework version which contains "System.Diagnostics.Tools, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".
1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(1987,5): warning MSB3268: The primary reference "Microsoft.ReportViewer.Design" could not be resolved because it has an indirect dependency on the framework assembly "System.Reflection, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" which could not be resolved in the currently targeted framework. ".NETFramework,Version=v4.0". To resolve this problem, either remove the reference "Microsoft.ReportViewer.Design" or retarget your application to a framework version which contains "System.Reflection, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".

The application builds successfully and everything seems to work, but I'm a still little concerned about the warnings.

However, my coworkers are not seeing these warnings, and the only obvious difference I could tell is that they are using Windows 10 and I'm on Windows 7. Maybe it also has something to do with prior Visual Studio Versions I have/had installed?

I am grateful for all answers!

PS: I've also asked this question on StackOverflowabout a week ago, but couldn't get any answer - so I'm trying it here



Sponsored



Replies

Henry Jiang on Tue, 12 Sep 2017 07:53:00


Hi powerzone3000,

This could be related to your framework version. As the warning reminded, the reference "Microsoft.ReportViewer.Design" cannot be resolved in your current framework. Personally, you could try with upgrade .Net Framework. To upgrade it, you could refer to https://www.microsoft.com/en-us/download/details.aspx?id=55170 and How to: Determine Which .NET Framework Updates Are Installed

Best Regards,

Henry 

powerzone3000 on Thu, 14 Sep 2017 07:12:36


Hi Henry,

thanks for your reply. I have already installed .NET Framework versions from 2.0 to 4.7.
Aside from that, I'm currenty bound to target .NET Framework 4.0 with my application to support some Windows XP Clients.

The question is: Why isn't Visual Studio/MSBuild referencing the correct assemblies for my target framework?
Or is this ReportViewer Version incompatible with .NET 4.0? But if so, why don't my coworkers seem to have any issues with it?

Best Regards

Henry Jiang on Fri, 15 Sep 2017 03:01:29


Hi powerzone3000,

Thank you for your reply. The ReportViewer Version is compatible with .NET 4.0. Regarding VS not referencing the correct assemblies, I suspect when referencing, it uses other .NET versions other than the expected one since you have multiple frameworks on your machine. The issue is about VS references assemblies, so I suggest you could also go to VS community for professional support.

Best Regards,

Henry

powerzone3000 on Fri, 15 Sep 2017 09:22:42


Ok Henry, I'll try it over there.

I started another thread in the Visual Studio > MSBuild subforum: https://social.msdn.microsoft.com/Forums/en-US/21fd273d-8f2b-41cf-adf7-dd7506e57e43/msbuild-referencing-assemblies-with-wrong-target-framework-version-warning-msb3275-warning?forum=msbuild



Henry Jiang on Mon, 18 Sep 2017 05:49:48


Hi powerzone3000,

Thank you for your reply. Or to narrow down the issue, you could try with another VS version as your colleague's and build the same report to see if there are any warnings prompting.

Best Regards,

Henry

powerzone3000 on Wed, 20 Sep 2017 06:45:15


Hi Henry,

my colleagues an I are both using Visual Studio 2017. I also tried with VS 2015, but it's the same issue.

However, I suggest to continue the conversation in my other thread, to not make it too confusing.

Henry Jiang on Thu, 21 Sep 2017 09:58:38


Hi powerzone3000,

Thank you for your reply. Navigating to your other thread, it seems the issue has be resolved. If you would like to report this issue, personally, I recommend you that submit this suggestion at https://connect.microsoft.com/SQLServer/ . If the suggestion mentioned by customers for many times, the product team may consider to improve it in the later SQL Server version. Your feedback is valuable for us to improve our products and increase the level of service provided.

Best Regards,

Henry 


powerzone3000 on Thu, 21 Sep 2017 19:39:54


Hi Henry,

thanks for your reply. I will eventually go ahead and report it on MS Connect.

For the sake of completeness: I found a solution and posted it to the MSBuild forum: https://social.msdn.microsoft.com/Forums/en-US/21fd273d-8f2b-41cf-adf7-dd7506e57e43/msbuild-referencing-assemblies-with-wrong-target-framework-version-warning-msb3275-warning?forum=msbuild