07 November 2003 14:50 nielsb

Fun with Yukon, Whidbey and MSBuild


I mentioned in an earlier post how I was playing along with Whidbey, Yukon and Emacs, using MSBuild as my command-line compiler. Even though there will without a doubt be a task in MSBuild for deploying assemblies into Yukon, I thought it'd be a good idea to create one myself just to see how it works.

So ladies and Gentlemen, the "Deploy" task. A custom task to install assemblies into Yukon.

Below is an example of a build file using the task. As you can see, the task has - apart from the Name - five attributes:

  • AsmName - the name of the assembly, required.
  • AsmPath - full path to the assembly, required.
  • Permission - permission set for the assembly, optional; defaults to SAFE.
  • DeployDebug - Flag which indicates whether to deploy debug symbols or not, optional; defaults to false.
  • PdbPath - full path to the symbols, optional (required if DeployDebug is true).
  • ConnString - connection string to the Yukon database.

<Project DefaultTargets="Build">

  <Item Type="References" Include="c:\program files\microsoft sql server\mssql.1\mssql\binn\sqlaccess.dll"/>

 

  <UsingTask TaskName="DM.Build.Tasks.Deploy" AssemblyFile="c:\build\yukondeploy.dll"/>

 

  <Target Name="Build">

    <Task Name="Csc" Sources="simple.cs"

          References="@(References)" EmitDebugInformation="true"

          OutputAssembly="simple.dll" TargetType="library"/>

  </Target>

 

  <Target Name="DeployAsm">

    <Task Name="Deploy" AsmName="simple" AsmPath="n:/yukontest/proj1/simple.dll"

      Permission="0" DeployDebug="true" PdbPath="n:/yukontest/proj1/simple.pdb"  ConnString="server=localhost;database=test1;Integrated Security='SSPI'"

      />

 

  </Target>

 

</Project>

 

Download it from here and have fun!! Any comments etc. are always welcome.


Filed under:

Comments

No Comments