I want to create projects for multiple platforms (Windows, Xbox 360, Mono, etc.) which would all have some code in common. I don’t want to have to copy it over to each solution every time I make a major change that I’d want to include in all of them. I think there might be a way to set a project’s source code path. If so how do you do this? Could someone preferably post a step-by-step guide to make this easy? Also, if that isn’t the best way, what would you do for multiple platform projects?
PS: I’m using VStudio Express 2010
One immature solution from Microsoft is the portable class library. You can put some files in such a library and share among platform specific solutions.
However, Microsoft itself does not make it easy enough (you lose a lot of classes from the references if you put source files into such a project). It is painful. What’s more is that MonoTouch/Mono for Android profiles are not officially from Microsoft or Xamarin. I doubt if there is a step by step guide. There is a saying that Microsoft and Xamarin are working together to improve it, but I did not see any official announcement so far.
Another solution I would probably try next month (to port one of my open source projects to Mono for Android) is to create two project files. I can add common files to both projects, and then platform specific files to their desired platform projects. To avoid duplicate files in Visual Studio, you might sometimes use “Add as Link”.
BTW, note that you cannot use Visual Studio Express to develop Mono solutions.