Overriding the bin directory - msbuild

I am writing a MSBuild script for creating a one click deployment. Everything works great but the files are created in the app.publish under the bin directory. Is there a way to set the output directory to another directory instead of the default bin directory?
I used PublishDir but that just creates the setup.exe in the specified directory. The other files are still created under the bin directory.
Can route all the one click deployments to a specific directory or do I have to copy later?
Thanks,
Richard.

Have you tried OutputPath instead?
msbuild my_solution.sln /p:OutputPath=c:\my_dir

Related

Visual Studio ASP.NET Web API Precompiled files placed in a different folder with TFS

I have an asp.net web api project whose output needs to be packaged in a setup project using wix.
I would like to precompile the site. The problem is that the precompilation process generates variable file names (ie. *.compiled files in particular).
I also would like to build the setup in a TFS build.
It seems that my only option is to generate a .wxs file wihtin the prebuild step of the wix project.
The .wxs files source paths are using $(var._My_Web_Project_.TargetDir). This seems to be translated to a Sources based directory.
I'm using paraffin to do that already and it works perfectly fine when building the solution with visual studio.
When building the solution through a TFS build, the .compiled files are copied to a Binaries folder, whereas all the other related web site files are copied to a Sources based directory.
The build errors are like the following :
The system cannot find the file 'd:\BuildAgents\___basedir___\Binaries\___web_project_dir\_PublishedWebSites\___site___\bin\textsample.cshtml.c6fb271c.compiled'.
The file is indeed in the Sources directory.
'd:\BuildAgents\___basedir___\Sources\___web_project_dir\_PublishedWebSites\___site___\bin\textsample.cshtml.c6fb271c.compiled'
I think I somehow need to redefine the aspnet_compiler output or something like this, but can't figure out how to do that.
The msbuild command line arguments are the follwing:
/p:GenerateProjectSpecificOutputFolder=true /p:VisualStudioVersion=14.0 /p:DeployOnBuild=true /p:PublishProfile=local /p:CleanWebProjectOutputDir=False /verbosity:d
EDIT 1: I'm using XAML build.
Any help appreciated.
EDIT 2:
With the new task based build, it works as is (no need to use an additional Copy Files task).
The aspnet_compiler output the .compiled files in the correct folder :
C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_compiler.exe -v / -p D:\BuildAgents\vNext\_work\1\s\Softs\__Solution__\__Web_Project\obj\Release\AspnetCompileMerge\Source -c D:\BuildAgents\vNext\_work\1\s\Softs\__Solution__\__Web_Project__\obj\Release\AspnetCompileMerge\TempBuildDir
In the new tasks based build system, it's easy to copy files from a source folder to a target folder with Copy Files task.
Source Folder: Folder that contains the files you want to copy.
Contents: Specify minimatch pattern filters (one on each line) that you want to apply to the list of files to be copied.
Target Folder: Folder where the files will be copied. In most cases you specify this folder using a variable.

How do I set up the MSBuild script to use the outdirectory's set in the csproj files while building the entire solution?

I'm not sure how I can get the MSBuild script to use the outputpath, outputdirectory values from the CSproj files. I've seen examples where I set the outputpath in the MSscript but that dumps the all the output in one big folder. I want the individual projects to have their own output paths and MSbuild to build the solution in such a way that the output for the projects and created in the corresponding output directories. Thanks.
There is not an easy way. One option is to extend MSBuild and have it copy the output from each project to a common folder.
If you look at the Microsoft.Common.Targets file in the c:\Windows\Microsoft.Net\Framework\v4.*\ you can see how it does load a custom targets file at both the beginning and end of that folder. If you add a Custom.After.Microsoft.Common.Targets to the C:\Program Files (x86)\MSBuild\v4\ folder you can have it load a file say $(SolutionDir)\Solution.targets. This will allow you to extend each solution differently and you can add any custom actions you want inside every solution that applies to every project. I use this and it works great.
Thanks for your answers guys. I found a way to run the solution without giving a specific output folder. I had to fix the output folder path to /bin in the csprojs and then running MSbuild with the solution was able to pick up those paths from the csprojs and build the output into those folders.

Where can I find the rootfolder for my VB.net project

I am making a project that will be put on a disc to use. This means that all of the files that I call upon have to be on that disc. How and where do I put my files to ensure that they will stay with the project? Does it go in the bin folder? And when I am calling on that file what file path do I use?
In general, the bin folder is not a place you should be storing anything that you want to persist with the project.
When you build, Visual Studio will copy the files needed to run the program into the bin folder, such as libraries and web.config or app.config files.
For other files you want included, add them to your project and set their build action property to Content:
Content - The file is not compiled, but is included in the Content output group.
For example, this setting is the default value for an .htm or other
kind of Web file.

How can I filter which files are included in a workspace using MSBuild?

It seems that MsBuild creates a folder called, "BuildType" on the build server and this folder is where the .proj file is copied. In source control I have several files that are in the same folder as the build project file. I have a workspace mapped to this location.
I would like to be able to specify explicitly which files from this workspace location should be copied to the build machine. Is this possible?
Thanks!
You cannot do this on file level but if you organize your build type folder with subfolders you can cloak the folders that you want to exclude.

intellij idea run configurations backup

I would like to create a script to modify my debug configuration in intellij. The path of tomcat changes, and i have to manually go into the run config and edit things. I have tried to find the place where intellij stores these settings to no avail.
question: does anyone know where IJ stores its run configuration
The location would depend on 2 factors, whether the configuration is local to the user or shared with the other developers and if you are using the file based (legacy) or the directory based project format.
File based project, local configuration: .iws file
Directory based project, local configuration: workspace.xml file under .idea directory
File based project, shared configuration: .ipr file
Directory based project, shared configuration: .xml file under runConfigurations subdirectory of .idea directory or files inside .run directory in the project root (you can customize the location of the shared configurations in the latest versions).
Its here .idea\runConfigurations (correct for Idea 11). Just copy this folder to new project.
EDIT: As per comment, if runConfigurations folder doesn't exist, check the 'Share' box inside the Run/Debug configuration