简体   繁体   English

构建后如何将Satellite程序集复制到其他文件夹?

[英]How to copy Satellite assembly to different folder after build?

I have a WPF project and I have added support for localization using Satellite assembly. 我有一个WPF项目,并且添加了对使用Satellite组件进行本地化的支持。 I have 2 cultures supported namely en-US and fr-CA . 我支持2种文化,即en-US和fr-CA

Now when I build the project, I get 2 folders namely en-US and fr-CA and the corresponding Satellite assemblies in the folder. 现在,在构建项目时,我将获得2个文件夹,即en-US和fr-CA,以及该文件夹中的相应Satellite组件。

The problem is after the project is built, I have to copy the contents of bin/debug folder into a different directory. 问题是在构建项目之后,我必须将bin / debug文件夹的内容复制到另一个目录中。

To copy the dll's I am using post build event copy /y "$(TargetPath)" "c:\\Temp\\Plugins\\" 要复制dll,我正在使用构建后事件复制/ y“ $(TargetPath)”“ c:\\ Temp \\ Plugins \\”

I want the 2 folders en-US and fr-CA also to be copied to "c:\\Temp\\Plugins\\". 我希望将2个文件夹en-US和fr-CA也复制到“ c:\\ Temp \\ Plugins \\”。 How do I do it? 我该怎么做? I dont want to hardcode names like en-US,fr-CA in the post build event because, we are planning to add support for atleast 30 languages ! 我不想在构建后事件中对诸如en-US,fr-CA之类的名称进行硬编码,因为我们计划增加对至少30种语言的支持!

Is there a generic way in which the Satellite assemblies can be copied to different directory after build ? 有没有一种通用的方法可以在构建后将Satellite程序集复制到其他目录?

**Note: I want only the Satellite assemblies, there might be lot of other files in bin/debug folder which I dont wanna copy ! **注意:我只需要从属程序集,bin / debug文件夹中可能还有很多其他文件我不想复制!

I don't think there is any other way to do this that adding copy, xcopy och robocopy lines with suitable patterns to the post build events. 我认为没有其他方法可以将带有合适模式的copy,xcopy och robocopy行添加到post build事件中。 For some strange reason we actually had to use different copy commands for single files, directories and groups of files as the some of the commands have a hard time handling folders if the target folder structure doesn't exist. 由于某些奇怪的原因,我们实际上不得不对单个文件,目录和文件组使用不同的复制命令,因为如果目标文件夹结构不存在,其中一些命令将很难处理文件夹。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM