Title: Building a Windows Live Agent: First steps
Slug: building-a-windows-live-agent-first-steps
Date: 2007-12-27 03:40:00
Author: Kartones
Lang: en
Tags: Development, Windows Live Agents, Visual Studio
Description: A tutorial on building a Windows Live Agent, using Visual Studio 2008 and the 5.0 SDK.

 <p>Starting with this post I'm going to not only provide general tips &amp; tricks about WLAs, but actually showing how the IDE works and the process of building an agent.</p> <p>I'm going to develop the agent fully and just using the 5.0 SDK, which is in pre-beta stage and scheduled to be available in the first quarter of 2008. And I will use Visual Studio 2008, but VS2005 is also supported.</p> <p>I assume you've already installed VS2008 and the SDK.</p> <p><b>Important note</b>: you must place your WLA SDK license file inside the new sdk folder "<i>C:\Program Files\Windows Live Agents SDK\</i>" in my machine. If not, the Management Console won't let you launch agents.</p> <p> </p> <p>Let's start by creating a new project with the supplied template:</p> <p><img src="https://images.kartones.net/posts/screenshots/building_a_wla_001.jpg"> </p> <p>And choosing our desired languages and extra features (pre-made libraries for basic chatting). I want spanish and english with all language features (I can always disable unwanted patterns via code).</p> <p><img src="https://images.kartones.net/posts/screenshots/building_a_wla_002.jpg"></p> <p>After creatin the files, here's how your project will look: </p> <p><img src="https://images.kartones.net/posts/screenshots/building_a_wla_003.jpg"> </p> <p>The <b>Shared</b> folder contains language-neutral files (this is where you should build your logic if you're developing a multi-language agent), while <b>Spanish</b> and <b>English</b> folders contain specific language code (this is where you should call language-neutral logic and present it in the desired language and formatting).</p> <p><b>Note</b>: <b>BuddyScriptLib</b> filder will be renamed as <b>WLALib</b> when 5.0 goes out of beta. You shouldn't touch the files inside it (if you need to modify anything, override the procedure/function instead).</p> <p> </p> <p>Some initial cleaning I've done is this:</p> <p>Delete the following files:</p> <ul> <li><b>/English/GenericQueries.txt</b>  </li><li><b>/Spanish/GenericQueries.txt</b>  </li><li><b>/English/Tests_en.ddl</b>  </li><li><b>/Spanish/Tests_es.ddl</b>  </li><li><b>/Shared/Tests.ddl</b>  </li><li><b>/README.txt</b> (but be sure to read it at least the first time you create a WLA)</li></ul> <p>Modify and/or remove unwanted languages in this files:</p> <ul> <li><b>/Variables.ddl</b> : Removed other languages references and responses (I still have to check the pattern contents and adapt to my desired responses).  </li><li><b>/Shared/Global.pkg</b> : Removed other languages references.  </li><li><b>/Spanish/Overrides.ddl</b> : Removed Mexican spanish references (I only will maintain Spain spanish). Adapted initial greeting to my preferences.  </li><li><b>/English/Overrides.ddl</b> : Removed all non UK english support (same, I will only maintain right now UK english). Adapted initial greeting to my preferences.</li></ul> <p>Configure the following file:</p> <ul> <li><b>/Zero.bfg</b> : Setup MSN accounts for staging and production agent (one per language).</li></ul> <p><b>Note</b>: MSN account passwords are no longer encrypted in the bfg file.</p> <p> </p> <p>And that's all, we've got a spanish + english agent, with all basic features, setup to launch in the Messenger cloud, with slight personalization and some initial cleaning performed.</p> <p>In the next tutorial we will continue customizing the agent and adding one or two new features, like showing data from an RSS feed.</p>
