Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

130
Vistas
unwanted culture specific dlls copied to bin directory

I am using visual studio 2013 & Fluent Validation 5.6.2

I see that after build in the bin folder it copies all the culture specific FluentValidation.resources.dll which seems to be mentioned it in .nuspec file

> <file src="lib\NET35\de\FluentValidation.resources.dll"
> target="lib\NET35\de\FluentValidation.resources.dll" />
>     <file src="lib\NET35\es\FluentValidation.resources.dll" target="lib\NET35\es\FluentValidation.resources.dll" />
>     <file src="lib\NET35\fr\FluentValidation.resources.dll" target="lib\NET35\fr\FluentValidation.resources.dll" />
>     <file src="lib\NET35\it\FluentValidation.resources.dll" target="lib\NET35\it\FluentValidation.resources.dll" />
>     <file src="lib\NET35\nl\FluentValidation.resources.dll" target="lib\NET35\nl\FluentValidation.resources.dll" />
>     <file src="lib\NET35\pt\FluentValidation.resources.dll" target="lib\NET35\pt\FluentValidation.resources.dll" />
>     <file src="lib\NET35\sv\FluentValidation.resources.dll" target="lib\NET35\sv\FluentValidation.resources.dll" />

But I do not need these in bin folder, because project does not support any culture specific messages.

So how can I tell vs-build to ignore these culture specific dlls?

over 4 years ago · Santiago Trujillo
2 Respuestas
Responde la pregunta

0

My solution was to add this target at the end of the .csproj file before the closing project tag.

<Target Name="AfterPackage" AfterTargets="CopyAllFilesToSingleFolderForPackage" />

<ItemGroup>
    <FluentValidationExcludedCultures Include="cs;da;de;es;fa;fi;fr;it;ko;mk;nl;pl;pt;ru;sv;tr;zh-CN">
        <InProject>false</InProject>
    </FluentValidationExcludedCultures>
</ItemGroup>

<Target Name="RemoveTranslationsAfterBuild" AfterTargets="AfterBuild">
    <RemoveDir Directories="@(FluentValidationExcludedCultures->'$(OutputPath)%(Filename)')" />
</Target>

<Target Name="RemoveTranslationsAfterPackage" AfterTargets="AfterPackage">
    <RemoveDir Directories="@(FluentValidationExcludedCultures->'$(_PackageTempDir)\$(OutputPath)%(Filename)')" />
</Target>

It's not pretty, but it gets the job done. If you need some culture specific resource, just remove the corresponding line from the list. If a future update adds a new culture that you don't want, add it to the list.

The best option would be ask the developer to separate the resources in multiple nugets, this way you could just add the ones needed. I'll stick with this solution, for now, until someone come up with a better one.


Now you can find my solution at the official project wiki: https://github.com/JeremySkinner/FluentValidation/wiki/f.-Localization (at the bottom of the page)

over 4 years ago · Santiago Trujillo Denunciar

0

i had same problem with external library, i'm add post-build script in Visual Studio project properties, which delete all folders (for me it`s okay, otherwise set list of dirs) at output directory:

FOR /D %%d IN ($(TargetDir)*) DO RMDIR /S /Q %%d
over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda