i have created a Custom tool (SingleFile generator) using IVsSingleFileGenerator. Which takes "xyz.Resx" file as input and generate "xyz.Designer.resx.cs" file. This file can be generated on building/Saving the Application through IDE.
Issue is, I have given the Custom Tool Property for any .Resx file and build the application through MSBUILD. Now I am unable to build/
generate the "Designer.resx.cs" file.
How to prepare a Custom Task to run this custom tool through MSBUILD.
plz help in doing the same.
Thanks in advance.
I don't have much knowledge about this custom tool IVsSingleFileGenerator which you are using. To execute it in MSBuild you may need targets for the same given by them to generate the resx.cs file from .resx file. Or you may add a commandline call of this tool in your MSBuild script and try it.
I don't think you can run CustomTool from MsBuild. Since you're the one that wrote the tool, I would definitely suggest to create msbuild task and start using it.
Here are some ideas how to do that:
http://msdn.microsoft.com/en-us/library/t9883dzc.aspx
http://blogs.msdn.com/b/msbuild/archive/2006/01/21/515834.aspx
Another approach would be to write executable, but that will be less efficient.
Here is how you call executable from msbuild
<Target Name="your-target-name" AfterTargets="the-starting-point-of-your-target">
<Exec Command="your_exutable-here parameters_here" WorkingDirectory="your_working_folder" />
</Target>
Third approach would be to write inline msbuild task
http://blogs.clariusconsulting.net/kzu/writing-inline-msbuild-tasks-in-c-for-one-liners/
I hope that helps
Related
I have a TFS xaml Build template that runs the msbuild.sonarqube.runner start (and end) before and (after the) msbuild task in the xaml.
It all works well enough with a .sln file. As the file under build.
However, when I attempt to use this on a build that runs msbuild on a .csproj file the end process reports that it cannot find the postprocess exe.
"Execution failed. The specified executable does not exist: .sonarqube\bin\MSBuild.SonarQube.Internal.PostProcess.exe"
there no error indication given by the Start command.
is there something special I need to do to get this to work, or is this a limitation of the MSBuild runner?
Please help.
My whole team is keen to use the tool, but as it is only a fraction of the existing builds are being analyzed
thanks
Jeff Gedney
The begin and end commands of the SonarQube Scanner for MSBuild, as well as all msbuild commands MUST be launched from the same current working directory. Indeed, they will all need access to the .sonarqube folder that is created by the begin command.
Other than that, you can launch MSBuild on a *.csproj file instead of a *.sln if you prefer - that is supported by the SonarQube Scanner for MSBuild.
I've created the following ticket to improve the error message in case end is launched from the wrong folder: https://jira.sonarsource.com/browse/SONARMSBRU-160
Make sure you put yourself in the root folder of the project you want to analyze, then run the following commands:
a.MSBuild.SonarQube.Runner.exe begin /k:"sonarqube_project_key" /n:"sonarqube_project_name" /v:"sonarqube_project_version"
b.Build the project, for example: msbuild /t:Rebuild
c.MSBuild.SonarQube.Runner.exe end
Check:http://docs.sonarqube.org/display/PLUG/C%23+Plugin
I'm trying to use MSBuild to create a target that will create an installer with InstallShield 2012. I'm having difficultly understanding how to access InstallShield. I ran across this mentioning an InstallShield task but I'm not sure how to get access to it. I think I need a UsingTask directive, but not sure what to import. Can someone give me a pointer on how to get this going? Thanks.
You need to import the targets file. Took me a while to figure that out as well since it's in the msbuild extensions directory together with a dll. Here's a basic sample of how to use it (note this is for 2012Spring but you get the idea):
<Import Project="$(MSBuildExtensionsPath32)\InstallShield\2012Spring\InstallShield.targets" />
<Target Name="BuildInstaller">
<InstallShield.Tasks.InstallShield
Project="/path/to/my.ism"
ProductConfiguration="Package"
ReleaseConfiguration="MSI" />
</Target>
Btw if this doesn't work out for some reason, you can always invoke ISCmdBld.exe in an Exec task, it will do the job just as fine.
InstallShield provides Visual Studio integration. When you create an InstallShield project in VS it creates a project file (.ISPROJ) which imports the InstallShield.targets file for that version of InstallShield. The project file contains plenty of examples on how to build a particular configuration and pass in such things as merge module path, properties, path variable overrides and so on.
Please note that building InstallShield requires the x86 MSBuild platform due to COM components.
I can see that MSBuild makes use of the /t:Package on the command line, but what's the euivalent for including this option in an msbuild script file.
The equivalent in a build script file is to use the MsBuild task. See link below.
Msdn Build Task
Are you invoking an msbuild script from another script using the MsBuild task? If so, the parameter you want to use is Targets http://msdn.microsoft.com/en-us/library/z7f65y0d.aspx.
I've created a custom MSBuild task for our database project. This tasks uses XLSX file to generate reference data insert scripts that get merged into the post deployment script.
I tested this with a test MSBuild proj and it works well.
Now when I integrate it into the real DBProj file, the output of the task is duplicated and I cant see the MSBuild output logging.
So, my questions are:
1) How can I see the full MSBuild logs in Visual Studio?
2) I'm not sure AfterBuild or BeforeBuild is running twice but maybe?
Thanks
You can debug your MSBuild scripts, set breakpoints, inspect values, etc... See here: http://blogs.msdn.com/b/visualstudio/archive/2010/07/06/debugging-msbuild-script-with-visual-studio.aspx
As part of a build process .. I would like to block the build until a file gets created (exists) remotely at an ftp location, after which I would continue the build. (Preferably with somekind of time out limit).
Suggestions?
Is this even possible using only the standard msbuild task and/or extensionPack/communitytask?
Your best bet is to build a small custom exe (you can even compile it as a build step) that polls for the file you are looking for. Then you use the PreBuild target, or a custom target in a pre-build step to verify that the file exists.
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Target Name="WaitOnFTP">
<Exec Command="MyFTPWaiter.exe"/>
</Target>
</Project>
Other more MSBuild oriented suggestions are to remake that exe as a custom task, or even an inline task in MSBuild 4.0.
FWIW, I've encountered a similar solution done by a peer who didn't want large binaries used by integration tests in version control and he required the use of a custom downloader in the build to get the files from a SMB share. It worked well enough.
Custom Tasks
Inline Tasks