the application requires that assembly microsoft.reportviewer.processingObjectModel version 11.0.0.0 be installed in the global assembly cache first

前端 未结 9 1017
天涯浪人
天涯浪人 2021-02-08 18:08

I have a small windows forms application created in Visual Studio 2012 that uses ReportViewer version 11.0.0.0.

The application target framework is .NET 4.0 and its depl

9条回答
  •  栀梦
    栀梦 (楼主)
    2021-02-08 18:55

    If you are using WinForms, to me it seems pointless to worry about installing this DLL in the GAC when it's being used for a report viewer that is deployed via click-once. This isn't a big file and you're probably using it as a report viewer control on a form, nothing more. One possible solution is to do the following:

    1. In Visual Studio, go to the reference in your project for the assembly Microsoft.ReportViewer.ProcessingObjectModeland locate the file path to the folder for that assembly. Mine was version 12 and so my file path was C:\windows\assembly\GAC_MSIL\Microsoft.ReportViewer.ProcessingObjectModel\12.0.0.0__89845dcd8080cc91
    2. Copy the file path of the folder the assembly is in and remove the reference from your project (right click the reference and select "Remove").
    3. Win + R to get a 'Run' prompt. Paste that folder path in there and execute to jump right into the folder of that DLL.
    4. Find the DLL, it should be the only file in that folder, and copy it to your Visual Studio project folder. You shouldn't care about 100kb of extra space on your drive consumed, and I don't think this DLL is one you'll need to update.
    5. Back in Visual Studio, right click References, Add Reference, and browse for that DLL in your project folder. After adding the reference, make sure that the Copy Local property is set to true.
    6. Clean and rebuild, test the application on your local computer, than Deploy your ClickOnce again.

    Now when users install your application with ClickOnce, the reference will not refer to the GAC at all and there won't be any need to rely on the prerequisite check/installation process for this DLL because you have included it directly in your published application.

提交回复
热议问题