2014-11-08 185 views
21

我只是碰到下面的錯誤有:類型或命名空間名稱「報告」不存在命名空間「微軟」

The type or namespace name 'Reporting' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)

添加此我的代碼後:

protected global::Microsoft.Reporting.WebForms.ReportViewer ReportViewer1; 

我我看到了一些解決方案,我必須添加一些程序集。但他們都沒有工作。 這裏是一個例子:

<add assembly="Microsoft.ReportViewer.Common, Version=9.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/> 
<add assembly="Microsoft.ReportViewer.WebForms, Version=9.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/> 

任何人都可以幫助我嗎?

回答

16

我是通過右鍵點擊參考文獻文件夾在我的項目中,然後選擇添加引用。然後將Assemblies> Extensions> Microsoft.ReportViewer添加到引用。

0

進口來自: C:\ Program Files文件(x86)的\微軟的Visual Studio 11.0 \的ReportViewer \ Microsoft.ReportViewer.WebForms.dll

+0

你可以通過[編輯](http://stackoverflow.com/posts/32881033/edit)來解釋它是如何工作的。 – dorukayhan 2016-08-24 04:55:04

17

在我來說,我需要真正麻煩的機器上安裝Microsoft報表查看器。

中,其他的都是可用的,則可以計算出從Version=上dll需要哪一個。就我而言,我需要版本11(2012年版本)。

1

只需安裝SSDT。然後,您需要刪除損壞的引用並從「Assemblies」>「Extensions」重新添加它。

7

所有這些安裝對我來說都不起作用。什麼工作對我的Visual Studio 2015年內部安裝以下兩個包從的NuGet(我只需要這兩個)(菜單項目>管理的NuGet包):

  • Microsoft.ReportViewer.Common.VS2010
  • 微軟。 ReportViewer.WinForms.VS2010

該引用被自動添加到當前項目。

+0

這是我在VSTS在線遇到這個問題時爲我排序的 – tomRedox 2018-03-08 19:28:08

相關問題