Exclude un-necessary DLLs from WebGL build

Hi,

When building a WebGL project, these DLLs are added to the build while I don’t need them :

C:/Program Files/Unity5.5.0p1/Editor/Data/UnityExtensions/Unity/UnityHoloLens/RuntimeEditor/UnityEngine.HoloLens.dll
C:/Program Files/Unity5.5.0p1/Editor/Data/UnityExtensions/Unity/UnityHoloLens/Runtime/UnityEngine.HoloLens.dll
C:/Program Files/Unity5.5.0p1/Editor/Data/UnityExtensions/Unity/PlaymodeTestsRunner/UnityEngine.PlaymodeTestsRunner.dll
C:/Program Files/Unity5.5.0p1/Editor/Data/UnityExtensions/Unity/Advertisements/UnityEngine.Advertisements.dll
C:/Program Files/Unity5.5.0p1/Editor/Data/UnityExtensions/Unity/UnityAnalytics/UnityEngine.Analytics.dll
C:/Program Files/Unity5.5.0p1/Editor/Data/UnityExtensions/Unity/UnityPurchasing/UnityEngine.Purchasing.dll

As well as these, while I imagine they could make more sense (depending on what “Networking” features they serve)

C:/Program Files/Unity5.5.0p1/Editor/Data/UnityExtensions/Unity/Networking/UnityEngine.Networking.dll
C:/Program Files/Unity5.5.0p1/Editor/Data/UnityExtensions/Unity/Networking/Standalone/UnityEngine.Networking.dll

Is there a way to remove it from the build ?

Thanks,

Yvan

1 Like

Is there any solution to this? I am seeing the same issue.

If you are not using any of them they will not be included in your build automatically if you enabled “strip engine code” in the Player Settings (enabled by default).

Check “Disable HW Statistics” in your build settings(pro only).

Doing so has no effect, I even tested this on a blank project with no scripts or assets. After the build the managed data folder is bloated with unnecessary and unused libraries. This is really starting to frustrate me.

In order to receive some actual help you’d need to be more specific:

What version are you using? What are theses libraries that end up in your data folder?

I am using 2017.3.1.1f1. The libraries showing up in my build folder that I know I do not need include:

UnityEngine.ARModule
UnityEngine.Networking
UnityEngine.PerformanceReportingModule
UnityEngine.Timeline
UnityEngine.UNETModule
UnityEngine.UnityAnalyticsModule
UnityEngine.UnityConnectModule
UnityEngine.VehiclesModule
UnityEngine.VRModule

I have tried removing these references from the solution explorer but the assemblies still show up in my build. I don’t understand why you can’t manually specify which assemblies to include in a build or why the engine isn’t stripping these unused assemblies after compiling. My game does not support AR or VR, these are useless. My game is also single player, networking of any kind is useless. I don’t even know what the vehicles module is for but assuming I know what it is for, it is useless to me. I am not too aware of the Performance Reporting Module but I already have my own error and performance reporting system that my studio uses in all of our software, so this is also useless to me as well unless this is to send information to your side.

Edit:
I also have analytics disabled for my project (Windows standalone build by the way), so why is that module being included? I am also using Unity Personal for now, I just switched from 4.5 Pro. So far it has been an amazing experience, besides this little bloating issue. Also why is the UnityPlayer.dll showing up in my base folder? Is it possible to relocate this to another location?

The logic should be to have a listview and be able to check/uncheck in function of what we need … especially by playing with the asset bundle

When making a WebGL build you will not end up with DLLs in you build folder. The Build folder will contain several files ending on *.unityweb (code, framework, memory, data) so something seems to be off.

If you are however making a Windows Standalone build then you are correct with your assumptions since that doesn’t support the stripping of these yet. Sorry.

How can you check what part of Unity is included in your build when strip engine is enabled ? In the editor log right after the build ?

After your build finishes go to Build Report and click the button. This should then load a page that shows you what is in your build and ideally also what referenced it.

We have plans to bring this info into the editor in the future.

1 Like

Neat, thank you :slight_smile: