-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Facades and NotSupported assemblies are bloated with resources they don't use #28888
Comments
Is this issue only to track those two cases? We also have the case where some resources are only used in a specific configuration but not in the rest. Of course fixing that issue would be harder than simply addressing the two cases you discussed above, but just wanted to know the scope of this issue. |
ATM this doesn't account for the per-configuration case since I imagine those have more nuanced requirements. |
Would this be done by setting to true (if not already explicitly set to false) if is true, then explicitly setting to false as needed to fix the build? Where would such a change go -- I could maybe do this if someone can give pointers. |
Fix for that is trivial, here is where we add the embedded resources to all projects when strings.resx exists: Lines 18 to 25 in 83d19de
The way to fix what Eric suggests as point #1 above is to add a line in the property group before this line to say something like: <OmitResources Condition=“'$(OmitResources)' == '' and '$(IsPartialFacadeAssembly)' == 'true'”>true</OmitResources> |
And of course after doing that for any partial facade that breaks the build would need to set OmitResources to false on the csproj for that tfm since it will mean that partial facade still requires the resources which is fine. |
With the edit above, after building
|
|
The above leaves 87 projects that have IsPartialFacadeAssembly for at least one TFM but apparently don't need resources. However, many of those are in the shared framework, so it has no real impact as they're linked away
Yup |
The PF in S.IO.FS.AC only uses 1 string, but there's only 26, not work special resx perhaps. |
Often times we have builds that cross-compile and have very different implementations. Our resource conventions don't force folks to think about this, so the resources are often a superset of all configurations.
We should change the defaults so that this isn't the case.
I propose the following:
Across all our builds this will save over a MB of unused resources.
The text was updated successfully, but these errors were encountered: