12

I'm using nuget and am downloading the AjaxControlToolkit. The problem I have is that I don't want 20 extra folders to be created in the bin directory for different languages. Each folder only has a single file named 'AjaxControlToolkit.resources.dll' in it. I don't need the extra folders as our app will never be used with anything but English.

The only way that I've been able to omit the files is to follow this: http://blogs.msdn.com/b/webdev/archive/2010/04/22/web-deployment-excluding-files-and-folders-via-the-web-application-s-project-file.aspx where you have to manually add a line to the actual project file. I feel like there should be a better way to do this.

EDIT: This is the line that I currently add to my .csproj file:

<ExcludeFoldersFromDeployment>Bin\ar;Bin\cs;Bin\de;Bin\es;Bin\fr;
    Bin\he;Bin\hi;bin\it;bin\ja;bin\ko;bin\nl;bin\pl;bin\pt;
    bin\ru;bin\tr-TR;bin\zh-CHS;bin\zh-CHT</ExcludeFoldersFromDeployment>
David Rogers
  • 2,601
  • 4
  • 39
  • 84
Dilbert789
  • 864
  • 2
  • 14
  • 29
  • 3
    "when using Nuget?" - this is nothing to do with Nuget. The author of the package has deemed that satellite assemblies for all cultures should be included in the base package (rather than, say, being in a separate package that depends on the base package). So unless you can persuade the author to do otherwise, all you can do is delete the stuff you don't want. – Joe Nov 21 '13 at 20:14
  • 1
    Any answer to this query ?? – Usama Khalil Jan 15 '14 at 07:17
  • @Usama As Joe said above, the issue isn't with nuget, it's with the control pack. So the only solution so far to hide other languages is to do the workaround provided in the original question. If Joe had put his reply as an answer, I would have marked it as correct. – Dilbert789 Jan 16 '14 at 18:50

3 Answers3

4

No you cannot switch this "feature off" Nuget simply downloads the archive package and places the files where thee package information file says the files are to go.

You need to manually omit these files yourself - or, build your own AjaxToolKit from their source with the extra languages omitted in advance.

Dave Gordon
  • 1,815
  • 4
  • 30
  • 52
2

I had the same problem (similar answer here) and I haven't found a better way to do it either, I pursued the same method you mentioned however for some reason "ExcludeFoldersFromDeployment" didn't seem to work for me, but I found a alternative way to do the same thing though:

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

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

(Basically I put custom build events to clear out the extra files by deleting them after the build is run...)

David Rogers
  • 2,601
  • 4
  • 39
  • 84
0

tldr: i deleted ja de ru folders that resides in mySolution/packages/offending_lib_v1.2.3/. now it wont copy satellies(ja,de ) into my debug folder, when i build.


long:

  1. there is packages folder in the same folder with your mySolution.sln file.

  2. go in packages folder.

  3. find that thirdparty-that-creates-ja-de-ru-on-Build.dll.

  4. search every folder inside . delete ja de ru folder.

done!.

  1. delete ja de ru from bin/debug (residue from last build)

now when you build or debug, se ja de ru folders wont be cretated in your bin/debug folder.


note: if you update that nuget package, that folder will be recreated. you have to do it again.


How to Find Your Solution Folder. in visual studio > solution explorer > MySolutionName (first at the top) > rightClick > open in explorer . (that is the folder)

bh_earth0
  • 2,537
  • 22
  • 24