1

I'm doing some work on one of my Winforms applications that was created in VS2017. I'm doing the new work in VS2019. The application contains the Winforms report viewer control which wasn't working properly in VS2019 so I followed the advice given in this post to get everything working again. This means, adding a nuget package to the project and directly referencing the required libraries from the "packages" folder in the project directory.

The application is working fine now, however, the issue comes when I try to publish using clickonce. Under the "Publish" > "Application Files..." there are MANY more references there then previously (without nuget package) and, when I publish my deployment size has ballooned to 80+mb. This is a global application and copying 80+mb can be a bit time consuming over the WAN.

If anyone can suggest how I can get back to a smaller deployment size, it would be very much appreciated. Thanks.

Application is: .NET Framework 4.5, Winforms, with NuGet Packages: Microsoft.ReportingServices.ReportViewerControl.Winforms and Microsoft.SqlServerTypes

beeker
  • 780
  • 4
  • 17
  • 1
    The thing about Nuget is that it's going to download and install the .dll's and all the dependencies. You might not be able to safely delete any, but if you can then you could make a script to package only the necessary deployed files and copy only those across the network. If you're using .net Core then you're going to need a lot more dependencies for winforms. – Zakk Diaz Sep 04 '19 at 17:10
  • Ok, appreciate the info. – beeker Sep 05 '19 at 16:42
  • Haven’t been back to work yet :) – beeker Sep 09 '19 at 02:04
  • Ok, any update feel free to let me know :) – LoLance Sep 10 '19 at 07:07

1 Answers1

0

If anyone can suggest how I can get back to a smaller deployment size, it would be very much appreciated. Thanks.

For this issue, I think you can feel free to remove the additional packs before you publish the project to reduce the deployment size.

Let us check the content in the Microsoft.ReportingServices.ReportViewerControl.Winforms package's lib folder:

enter image description here

It's obvious that it have ten language packs which contains the assemblies for different culture.All the ten laguage packs have these four assemblies:

enter image description here

When you reference this nuget package in your project and build the project, it will use the base English version.(In my machine with English language)

But when we use ClickOnce to publish it, it will fetch all assemblies in the lib folder, which is the main cause why your deployment size has ballooned to 80+mb. So if you're using English environment or other language environment you can exclude unnecessary assemblies in those language packs you don't use in the Application Files setting in Project=>Properties=> Publish. See:

enter image description here

I excluded the additional ones which I don't need and it reduced for almost 40mb size in my machine. Also, similar issue see here. Hope it helps :)

Community
  • 1
  • 1
LoLance
  • 25,666
  • 1
  • 39
  • 73
  • I was able to remove a few of the languages and this helped save me a bit on the deployment size, thanks! – beeker Sep 10 '19 at 17:51