Reputation: 1545
The bin
folder, as well as the obj
folder are ~100MB for some readon. Also, the publishable packages are about ~50MB as well. Is this normal? I don't think Win8.1 apps took that much space.
Also, if i wanna send my app to a freind do I need to send them all the files? Or will just the .appx*
plus the PowerShell script will do?
Thanks!
Upvotes: 0
Views: 526
Reputation: 10015
Bin and obj folders contain everything Visual Studio needs to build and debug your app. For UWP projects, you can ignore these folders as you can't just copy/paste the .exe file to another pc.
The size of your package is defined not only by your code, but also assets (typically large images or even sounds/videos) and the libraries you use. The main reason Windows 10 UWP packages are quite large (even for simple apps) is that all used libraries (also the standard .net ones) are packaged with the app. This to make sure the correct version of an assembly is available for your app as UWP apps are no longer using the GAC.
In a new project, you might be "only" using a single package: Microsoft.NETCore.UniversalWindowsPlatform
(currently version 5.2.2). But if you check the dependencies of this package, you'll notice it drags in a lot of other assemblies as well, which will be packaged.
Compiling in Release mode (.NET Native) will strip out any types that are not used, so those builds are already partially optimized for size (but mainly speed), but take longer to build.
The good news however is that whenever you install or update an app from the Windows Store, only the parts of the package are downloaded that are not available on your system yet. So even if your package is 50mb, this doesn't mean you'll always download 50mb.
If you want to send your app to a friend for sideloading, simply create a package (not for the store). If you want you can leave out pdb (debug) symbol files to reduce the size.
This will put everything in a folder under \AppPackages\
with the correct version number. Zip this folder and send it to your friend. As your pc doesn't know your friend's pc configuration, it can't use the optimized process of the Windows Store to create a smaller package leaving out all files already available on his machine.
Upvotes: 4