MSB4062: The "Microsoft.Reporting.RdlCompile" task could not be loaded from the assembly Microsoft.ReportViewer.WebForms, Version=15.0.0.0

1

There are several similar Stack Overflow posts that are similar but not identical to this issue:

We have the Microsoft RDLC Report Designer (https://marketplace.visualstudio.com/items?itemName=ProBITools.MicrosoftRdlcReportDesignerforVisualStudio-18001) and are using Visual Studio 2019.

When attempting to build using the 64bit version of MSBuild to build some of our RDLC reports and we fail to build with the following error:

C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VisualStudio\v16.0\ReportingServices\Microsoft.ReportingServices.targets(24,2):
error MSB4062: The "Microsoft.Reporting.RdlCompile" task could not be loaded from the assembly Microsoft.ReportViewer.WebForms, Version=15.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91.
Could not load file or assembly 'Microsoft.ReportViewer.WebForms, Version=15.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies.
The system cannot find the file specified. Confirm that the <UsingTask> declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask.

Loading up fuslogvw shows the following bind log:

*** Assembly Binder Log Entry  (5/13/2020 @ 4:06:22 PM) ***

The operation failed.
Bind result: hr = 0x80070002. The system cannot find the file specified.

Assembly manager loaded from:  C:\Windows\Microsoft.NET\Framework64\v4.0.30319\clr.dll
Running under executable  C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\amd64\MSBuild.exe
--- A detailed error log follows. 

=== Pre-bind state information ===
LOG: DisplayName = Microsoft.ReportViewer.WebForms, Version=15.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91
(Fully-specified)
LOG: Appbase = file:///C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/MSBuild/Current/Bin/amd64/
LOG: Initial PrivatePath = NULL
LOG: Dynamic Base = NULL
LOG: Cache Base = NULL
LOG: AppName = MSBuild.exe
Calling assembly : Microsoft.Build, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a.
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\amd64\MSBuild.exe.Config
LOG: Using host configuration file: 
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config.
LOG: Post-policy reference: Microsoft.ReportViewer.WebForms, Version=15.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91
LOG: GAC Lookup was unsuccessful.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/MSBuild/Current/Bin/amd64/Microsoft.ReportViewer.WebForms.DLL.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/MSBuild/Current/Bin/amd64/Microsoft.ReportViewer.WebForms/Microsoft.ReportViewer.WebForms.DLL.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/MSBuild/Current/Bin/amd64/Microsoft.ReportViewer.WebForms.EXE.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/MSBuild/Current/Bin/amd64/Microsoft.ReportViewer.WebForms/Microsoft.ReportViewer.WebForms.EXE.
LOG: All probing URLs attempted and failed.

Reviewing the VSIX Install Log (dd_setup_20200513155525_001_617ad572-c5b7-415c-b166-b2969077f719) and filtering for the DLL’s installed show this:

Completed: Copying file /$MSBuild/15.0/bin/Microsoft.ReportViewer.Common.dll to C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\15.0\bin\Microsoft.ReportViewer.Common.dll
Completed: Copying file /$MSBuild/15.0/bin/Microsoft.ReportViewer.ProcessingObjectModel.dll to C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\15.0\bin\Microsoft.ReportViewer.ProcessingObjectModel.dll
Completed: Copying file /$MSBuild/15.0/bin/Microsoft.ReportViewer.WebForms.dll to C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\15.0\bin\Microsoft.ReportViewer.WebForms.dll
Completed: Copying file /$MSBuild/15.0/bin/Microsoft.SqlServer.Types.dll to C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\15.0\bin\Microsoft.SqlServer.Types.dll
Completed: Copying file /$MSBuild/Current/Bin/Microsoft.ReportViewer.Common.dll to C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\Microsoft.ReportViewer.Common.dll
Completed: Copying file /$MSBuild/Current/Bin/Microsoft.ReportViewer.ProcessingObjectModel.dll to C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\Microsoft.ReportViewer.ProcessingObjectModel.dll
Completed: Copying file /$MSBuild/Current/Bin/Microsoft.ReportViewer.WebForms.dll to C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\Microsoft.ReportViewer.WebForms.dll
Completed: Copying file /$MSBuild/Current/Bin/Microsoft.SqlServer.Types.dll to C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\Microsoft.SqlServer.Types.dll
visual-studio
msbuild
rdlc
asked on Stack Overflow May 14, 2020 by aolszowka

1 Answer

1

The root cause appears to be that the 64bit version of MSBuild’s probing path expects the task to exist in the 64bit folder but that the VSIX installer does not place them there.

To work around the issue manually copy the following files:

C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\Microsoft.ReportViewer.Common.dll
C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\Microsoft.ReportViewer.ProcessingObjectModel.dll
C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\Microsoft.ReportViewer.WebForms.dll
C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\Microsoft.SqlServer.Types.dll

Into the 64bit Version of MSBuild Bin at C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\amd64

This has been reported to Microsoft (both the BI Group [via Email] and MSBuild to understand the probing location expectations).

answered on Stack Overflow May 14, 2020 by aolszowka

User contributions licensed under CC BY-SA 3.0