问题
I have a .Net 4 WPF application that is deployed through ClickOnce.
The application generates some reports locally and shows them to the user, so it has a reference to Microsoft.ReportViewer.WinForms
. These reports are .rdlc and embedded in the application as resources.
Recently, we upgraded the .dll from version 10 to the latest version 14 in order to view the newer schema definitions. The problem is that the older version did not have the option to show reports in other languages, but now, since it does, it includes additional folders in the deploy for each language (de, es, fr, etc.).
These folders add another 28.6 MB to the ClickOnce install (this effectively doubles our application installer size).
Since we do not need any of these language packs, is there a way to not include them when publishing the ClickOnce installer?
And are there any known side affects if these language version .dll's are not included?
Update: I am using post build events to delete the folders, and these remove the folders before the click once publish, but I assume that there is still some configuration so they are not included.
回答1:
You can remove the additional language packs from publishing during the ClickOnce publish.
- Open the Project Properties of the project you publish from
- Navigate to the Publish tab
- Click on the "Application Files..." button
- In the Application Files popup select the "Show all files" checkbox at the bottom
- Each language will have 3 dll's, if you set the Publish Status to "Exclude" they won't be published with the ClickOnce application
The problem I had was not clicking the "Show all files" checkbox and it looked like the language dll's were all included in the base dll's. If you do this then the ReportViewer will only ever show in the languages whose dll's you include.
If the language dll's are not included the ReportViewer will use the base English version. This is the same behavior as when the system language does not have a specific set of dll's.
来源:https://stackoverflow.com/questions/49553482/can-i-remove-the-reportviewer-language-packs-with-clickonce-installer