MSB4062:无法从程序集Microsoft.ReportViewer.WebForms,版本= 15.0.0.0中加载“ Microsoft.Reporting.RdlCompile”任务。

问题描述 投票:0回答:1
[有多个类似的Stack Overflow帖子与此问题相似但不相同:

当尝试使用

64位版本的MSBuild构建

构建某些RDLC报告时,我们无法构建,并出现以下错误: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.
加载fuslogvw显示以下绑定日志:

*** 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.

查看VSIX安装日志(dd_setup_20200513155525_001_617ad572-c5b7-415c-b166-b2969077f719)并过滤已安装的DLL显示以下内容:

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

[有几个类似的Stack Overflow帖子与该问题相似但不相同:TFS:无法从程序集中加载“ Microsoft.Reporting.RdlCompile”任务...
visual-studio msbuild rdlc
1个回答
0
投票
根本原因似乎是MSBuild的64位版本的探测路径希望该任务存在于64位文件夹中,但VSIX安装程序未将其放置在该位置。
© www.soinside.com 2019 - 2024. All rights reserved.