-
Notifications
You must be signed in to change notification settings - Fork 286
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
Prevent language resource dlls from being output #1368
Comments
Add a post build event with something like:
|
That will doubtless achieve the same result, but would need maintained as new language packs get added. Is there nothing systematic that switches this behaviour off? |
Hi @ensign-nemo. looking into this issue may help us to have a better understanding. I will look into it and I suggest you do too to see if there is anything to be done from your side. |
@ensign-nemo I looked into satellite packages. Currently we are supporting nine or ten different languages, hence using satellite packages for us requires maintaining (release wise) 10 different nuget |
for those who wants to follow, link to the MS doc and satellite assemblies for .NET. Link to one of MS libraris that uses that pattern Microsoft.AspNet.mvc as the primary language and German language at Microsoft.AspNet.Mvc.de. Once again this could be prioritize if it gets more interest from community. |
That's a pretty rare event. Implementing satellite packages for languages would add complexity. It also would greatly multiply the number of packages if we want to implement things like #1108. I don't see this being a big enough issue to be worth the effort over something like #1108. |
I am closing the issue as this will never going to happen due to complexity and conflict with other solutions/plans we have for future. |
the annoying thing for me is that most of these resource files are used to localize exception messages, which just result in making exceptions more difficult to google-bing for. So i get the tax of extra files to ignore/cleanup for a net-negative value |
@SimonCropp - I agree. If this were an open source project run by one or two volunteers I could understand responses like: But the project purports to be "the flagship SQL Server driver going forward" and I think it should have a best practice solution for localization. |
but that was a response from a dev from MS who maintains "the flagship SQL Server driver going forward"
"best practice" should be able to evolve over time when it become clear there is a "better practice" |
@SimonCropp, thanks for updating this thread, the fact that you do not need localization does not mean that they should not be there there are so many other users all over the world using the driver. One can easily delete those folders. The cons of having Satellite packages are more than its benefits in our case and it is in contradiction with our future goals with the driver as it was mentioned by @David-Engel . Regarding "best practice" topic, what are the facts and reasoning that put satellite package in "best practice" category for SqlClient driver? |
I believe that the SatelliteResourceLanguages property may be what you're looking for. It allows for an app to filter the language resources that will be included, even if referenced NuGet packages may include more. |
Genius - worked for me. Many thanks indeed. |
@dsplaisted great tip, generally very useful |
@dsplaisted thank you. |
For those that can't for some reason use the <Target Name="AfterBuild">
<ItemGroup>
<ResourceFiles Include="$(OutputPath)\**\Microsoft.Data.SqlClient.resources.dll"/>
</ItemGroup>
<RemoveDir Directories="@(ResourceFiles->'%(RootDir)%(Directory)')" />
</Target> This will delete every directory containing a |
Since switching to Microsoft.Data.SqlClient, we now get folders output for the following language codes:
de, es, fr, it, ja, ko, pt-BR, ru, zh-Hans, zh-Hant
Each folder contains a 250kb Microsoft.Data.SqlClient.resources.dll file, totalling 2.5Mb in all.
We don't have any need for these regionalisation/internationalisation resources, and yet they are generated every time. Presumably this list will grow over time as new languages are ported.
How do we prevent these folders from being generated and becoming part of the build product?
The text was updated successfully, but these errors were encountered: