il2cpp ios size too big in .net 4.6

unity 2017.3
An empty project generated c++ code with .net 2.0 subset is about 40mb

But with new .net 4.6,the generated code increaing to about 120mb

When we changed a production project to .net 4.6,this size increaing to over 850mb,but in .net 2.0 subset is 430mb

how about a .net 4.6 subset? or reduce the size generated.

have you tried .net standard 2.0? it should be smaller than the full 4.6

we want to use c# 6.0…

.net standard is the new runtime and allows c# 6 features. you are thinking of old .net framework 2.0 runtime

btw you can use most c#6 features even when targeting old runtime, you need to add “-langversion:6” to Assets/mcs.srp (you can’t use async)

1 Like

i wish a .net 4.6 subset that allow async, less c++ code generated.
in fact .net 4.6 cause 2x size any project…

We’re actively working on making the .NET 4.6 profile smaller. As you have experienced, it is really large compared to .NET 2.0. I would follow the advice of @M_R though, and use the .Net Standard 2.0 profile (which is available in 2018.1 beta and later). It is significantly smaller than the .NET 4.6 profile, and it will become our recommended profile for mobile and AOT platforms.

thank you so much!

@M_R thank you make me get a nice " langversion:6"