What I would like to do is create a super-simple VS2010 project that would generate a file using a batch script. This project will be necessary as a dependency for another. Is there a simple way of doing this?
Good question, Don. What you could do is create a new directory in your solution and place your script there. You would then create an MSBuild script called MyProject.csproj like the following:
<?xml version="1.0" encoding="utf-8"?>
<Project
ToolsVersion = "4.0"
DefaultTargets = "Build"
xmlns = "http://schemas.microsoft.com/developer/msbuild/2003"
>
<ItemGroup>
<InputTxt Include="$(MSBuildProjectDirectory)\input.txt" />
<OutputTxt Include="$(MSBuildProjectDirectory)\output.txt" />
<Script Include="$(MSBuildProjectDirectory)\script.cmd" />
</ItemGroup>
<Target
Name = "Build"
Inputs = "@(InputTxt);@(Script)"
Outputs = "@(OutputTxt)"
>
<Exec Command = '"@(Script)" "@(InputTxt)" "@(OutputTxt)"' />
</Target>
</Project>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With