Xamarin Studio - How to output several projects to one directory - xamarin-studio

I want to build several projects from one solution (executable and class libraries) to one "output" directory. How do I do this? The only way I can see is using custom-created commands for the "After-Build" event which seems klunky!

Right-Click on the project settings, and under the build menu is an `Output" option which allows you to specify the output directory.

Related

Build configurations in Zerobrane Studio, is it possible?

Is there a way to have/use/implement build configurations in zerobrane studio?
I use corona and my current IDE is lua glider. Although the lua glider project has been dead for almost two years, I still use the IDE because it has build configurations. Is there anyway to have/achieve the same functionality in zerobrane studio?
To clarify, with glider's build configurations i can
1- auto insert code to the top of main.lua before build (example: isFreeVersion = false; OR isFreeVersion = true)
2- merge folders or copy contents from one folder into another before build (example: have two similar projects using common code; i put these code files in a common folder and copy its content to the project folder at build; that way i only edit these code files once)
Many thanks,
Luay

MSBuild task does not build solution file

I have a project file that should build another solution. I tried using the MSBuild task for this, like this:
<MSBuild Projects="MySolution.sln" Properties="Configuration=$(Configuration)"/>
I tried a lot of variants, like supplying hardcoded configuration, target Rebuild and so on. Building reports an error when I pass a wrong solution name, non-existing configuration or target and so on, so it definitely loads the solution and the project files. It exits relatively fast though and produces no output. According to documentation and examples, this should work though. I also tried passing an ItemGroup for the project, including project-specific properties as suggested by examples or in MSBuild - How to build a .NET solution file (in an XML task script) from pre-written command line commands , but that does not work either. It runs without error but no output.
When passing a list of project files instead (or a single project file), it builds correctly, but the problem is that dependencies between the projects are not properly resolved. At the end, I have to supply all project files in the solution and add them to the list, which is what I want to avoid.
So, why does solution building not work, even though it should? What is wrong here?
Is this a .net project? If so you probably need to pass in a platform as well as a configuration.
<MSBuild
Projects="MySolution.sln"
Targets="build"
Properties="Configuration=$(Configuration);Platform=$(Platform)" />
If the project just contains web sites and libraries then the platform should be Any CPU if your solution just contains executables then x86 or x64 or if it's a mixture of different types of platform then you can use mixed platforms
To check what are available open the solution in Visual Studio, right click on the solution in solution explorer and select "Configuration Manager" you'll then have a drop down for "Active Solution Platforms"

Using VB.NET, how can I bring an existing project in an existing solution into a new solution so that it resides completely within the new solution?

I am creating an application which will coordinate and organize a lot of standalone functions. For instance, the main application might be called ABC Company Operations, and within it might be Engineering Bills Of Material and Project Management Purchase Orders, among many others. I want to develop each of these tools as a standalone solution, then include them in the main application when I am done with them. For one thing this will allow me to distribute the main application with a fair number of tools complete, then issue an update when each new one is included, and for another thing having these functions in their own projects will cut down on the madness inside the solution explorer.
Searching and reading have shown me how to include existing projects in a solution, but they are included as a reference - the files continue to reside in the standalone solution. This is not good because I wish to make any changes needed in the standalone, then replace the project in the main solution when those changes are done and also because I would prefer not to have all these solutions hanging around in a public place.
I tried just copying and pasting the project directory from the standalone solution into the main solution, but the solution explorer hasn't picked it up and there are somehow two listings of the standalone in the main Visual Studio screen where you select which solution you will work on. This seems like a bad road, so before I continue down it I would like to ask for any advice you folk may have.
Visual Studio allows you to reference the same project in different solutions.
Right click the solution in the solution explorer > Add > Existing Project...
I have done it and it works perfectly.
But very often referencing the DLL of a class library project is just enough. Usually you would reference the bin\Release version. You can even reference an EXE.
I achieve something like what you want by using the Subversion code management system. I keep each project in a directory. These are top-level directories in the Subversion repository.
Each solution is also a top-level entry in the Subversion repository, but does not have any projects in with it. So I have in my repository something like this:-
project directory
project
files directory
files
project directory
project
files directory
files
single-project-solution directory
single-project solution
single-project-solution directory
single-project-solution
multiple-project solution directory
multiple-project solution
I then use svn:externals to include all the needful project directories when either a single project solution or a multiple project solution is checked out, and it ends up in the working copy like this:-
multiple-project solution directory
multiple-project solution
project directory
project
files directory
files
project directory
project
files directory
files
or
single-project-solution directory
single-project-solution
project directory
project
files directory
files

How to build csproj files which exist in different workspace/folder in source control but are in the same solution

I have build definition which builds this single solution in source control:
$/MyTeamProject/Dev
So, I use this mapping on the 'Workspace' tab for the build definition:
Source Control Folder: $/MyTeamProject/Dev
Build Agent Folder: $(SourceDir)\Dev
I added a few more projects to this same solution. These other projects exist in a different branch/folder root in source control:
$/MyTeamProject/MyProductName/Dev
So, I added this to the Workspace for the same build definition:
Source Control Folder: $/MyTeamProject/MyProductName/Dev/MyCsProjFolderRoot
Build Agent Folder: $(SourceDir)\MyProductName\Dev\MyCsProjFolderRoot
Build fails with:
C:\Dev\Sources\Dev\AllProjects.sln.metaproj: The project file "C:\Dev\Sources\Dev\..\MyteamProject\MyProduct\Dev\MyCsProjFolderRoot\MyProj.csproj" was not found.
On the build machine, I see the sources downloaded correctly in the structure I expect, but obviously the build doesn't agree.
I reviewed this question: Project file was not found however I am still unclear how to implement this. I am also confused that on the Workspace tab, there is a 'Browse For Folder' button for Build Agent Folder which says 'Please select a local folder.'
Am I going about this all wrong? Do I really need to select a local folder for the Build Agent Folder? (or does that just mean it must be not be a UNC folder - it must be mapped?)?
Solved. It was indeed that the Solution had relative reference to the projects and my workspace mapping wasn't reflecting this exactly.

Wix - building files to subdirectories

I am new to WiX and am trying to get my install project to build certain files to a subdirectory of the build output path. For example, if my build output path is: bin\Debug, I would like certain files to be added to a subfolder here: bin\Debug\Images.
Is this possible please?
It looks like you are using a WiX project template with Visual Studio, MSBuild and/or SharpDevelop. If so, you have several options:
Use XCOPY in the Post Build Event.
flexible
somewhat easy to find in your project (on one of the project designer tabs)
not integrated well with the build system
Add the folder and files to your project folder, include them in your project and set the Copy to Output Directory on each file. Note: you can't set that property on a folder. The copying will preserve the folder structure but you have set the property on each file you want copied.
inflexible
very easy to find in your project (solution explorer and properties window)
Open the project file in a text editor and add MSBuild tasks such as Copy to the AfterBuild or other target. Note: To use VS to edit the project file, right click, select Unload Project, then right click and select Edit.
flexible
hard to find in your project (XML in the project file)
uses the build system
In the last case, I sometimes put a REM comment in the Post Build event to clue people into the fact that the project file has been customized.