How do I update an XML attribute from an MSBuild script?
When you want to script the build and deployment of your SSAS cube project, you will probably need to update XML attributes in deploymenttargets and/or deploymentoptions - typically found in the bin directory of your solution.
This is an easy way to do it and it is industry standard:
This is an easy way to do it and it is industry standard:
- First, Download and install MSBuild.Community.Tasks. You can download it from http://msbuildtasks.tigris.org/
- Import the MSBuild.Community.Tasks in the MSBuild proj file:
<Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\TeamBuild\Microsoft.TeamFoundation.Build.targets" /> - Use the XmlUpdate task to update the value of the XML attribute you want to change:
<XmlUpdate
Namespace="http://www.w3.org/2001/XMLSchema"
XmlFileName="C:\Projects\CubeTest\bin\CubeTest.deploymenttargets"
Xpath="//DeploymentTarget/ConnectionString"
Value="Provider=SQLNCLI10.1;Data Source=SERVER01;Integrated Security=SSPI;Initial Catalog=TestCatalog"/>
Comments
Post a Comment