1

I'm developing C# using Mono and MonoDevelop in Windows and Ubuntu. I might code the same project in Windows today and tomorrow in Ubuntu (which is why I chose Mono and MonoDevelop).

In project properties I need to add some After Build commands to copy some projects compiled files into some alternate folders. And I've done this like so:

cp ${TargetFile} ${SolutionDir}/SomePorject/bin/${ProjectConfigName}/Plugins

While this command works perfectly in my Ubuntu machine, each time I'm using Windows my Build requests get canceled since this command can not be executed in Windows (there's no cp in Windows). It makes this a pain to switch between Ubuntu and Windows since each time I need to change these commands.

Now my question is, is there a copy command which works in Windows and Ubuntu alike? Or maybe MonoDevelop has come up with a copy command of its own which works according to the OS it is running under!

4

2 回答 2

2

我认为“配置”是你要走的路。

为每个平台创建单独的配置(右键单击解决方案 -> 选项 -> 配置)。之后,在“自定义命令”中创建两个“构建​​后”命令,一个用于 Windows,另一个用于 Ubuntu。

当您构建解决方案时,只需从您的配置中选择您的平台。

于 2013-08-22T10:43:13.713 回答
0

你可以在你的 Windows 机器上安装 cygwin。

于 2013-08-22T18:03:32.907 回答