Posts

Exchange/Outlook integration, Time Zones and conversions

Generic code to create all tasks at 0000 at the app server time zone Wherever the app is installed, it will use that Time Zone – IST, EST etc private static void setMeetingTimeZone(CalendarItemType result) { // from http://msdn.microsoft.com/en-us/library/bb738399.aspx result.MeetingTimeZone = new TimeZoneType(); result.MeetingTimeZone.TimeZoneName = TimeZoneInfo.Local.StandardName; } private void saveOccurences(int recurringMasterTaskId, List occurences) { foreach (CalendarItemType occurence in occurences) { TaskDALC.InsertTaskOccurence(recurringMasterTaskId, TimeZoneInfo.ConvertTimeFromUtc(occurence.Start, TimeZoneInfo.Local), TimeZoneInfo.ConvertTimeFromUtc(occurence.End, TimeZoneInfo.Local), occurence.ItemId.Id, occurence.ItemId.ChangeKey, "", ""); } } Outlook client could be anywhere and can send a date not in sync with Exchange. So instead of Item.Start we send the date as Item.StartUTC in the script (plus there was a client culture related fix too). Month(It...

Inport 2009 Note

The 60+ posts showing a date of Feb 25 2009 were all imported here from a much older blog, but the dates were lost during the import process.

Outlook - attachment warnings and folder cleanups

'Press Alt-F11 and enter this first one in "ThisOutlookSession" to warn you whenever you write the word "attach" and forget to send an attachment 'If it doesn't work, reduce macro security to "medium" and restart Outlook Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean) Dim lngres As Long If InStr(1, UCase(Item.Body), "ATTACH") 0 Then If Item.Attachments.Count = 0 Then lngres = MsgBox("No attachment - send anyway?", _ vbYesNo + vbDefaultButton2 + vbQuestion, "No attachment") If lngres = vbNo Then Cancel = True End If End If End Sub 'This second one is trickier but more useful. It converts all mails in a folder to plain text and removes attachments. You have to add a rule to use it 'Enter this one in "ThisOutlookSession" too but add a rule to run when mails arrive and set it to run this script 'DO NOT enabl...

TFS issues raised and replies from MS

Q. Why does TFS Build require the 3.5 SDK even if it is building a 2.0 solution? Ans. Team Build uses MSBUILD in the background. When you installed Team Build 2008 it installs the 3.5 framework so when you run a build it using the 3.5 version of MSBUILD. This is hardcoded and cannot be changed. Q. A build server does not seem to be able to handle multiple builds on the same server since it causes workspaces to clash. It happens if you're trying to do 2 different builds on the same folders. It says one folder cannot belong to 2 workspaces. Is this because TFS uses file paths as absolute references to source safe paths once the workspace is created? Is there a workaround? Ans. Typically you queue your builds and the builds run one at a time sequentially so using the same workspace would never be a problem. You can run multiple build agents on the same computer, but doing so could cause problems like what you are seeing. When we do a build we lock down the build folder while doing th...

DB, UI and MSI builds with TFS

I just finished an app called “C:\XYZ\Content Center\Database\ABC_Dev\DbBuilder” It’s a simple app that parses through a set of Build items (sql or project files) and builds them against a DB. The Build items, DB details and a few other things are configurable. For ex, for a normal / daily build: <add key="BuildItems" value="Scripts\ABC50_ChangeScript.sql,Scripts\ABC52_ChangeScript.sql,Scrip ts\ApABConfig.sql,Scripts\DeleteOnlyCode.sql,Views\Views.ssmssqlproj,Triggers\Triggers.ssm ssqlproj, Procedures\Procedures.ssmssqlproj,Functions\Functions.ssmssqlproj"/> (I’ve also fixed DeleteOnlyCode.sql above and included dropping views) More importantly, I’ve finished integrating it with the TFS build system (which took longer than the actual application). So we can fully automate our DB build now. I’ve still not included it though since right now our DB build will fail. Please let me know if we should fix the DB errors first or if I should go ahead and include it anyw...

TFS multiple builds and build numbering

There were two problems in making a new automated build. 1. TFS requires a new build agent for every team project That means either installing 2 build services on Periyar or having a new build machine (Are we getting any value add out of having a separate team project for every branch?) 2. The same folder cannot be used as the workspace for more than one source control folder C:\XYZ can be used only for any one build The workarounds I did were 1. I am defining both the builds in the XYZProduct2 team project (I can point to any source control folder anyway) 2. There are now 3 virtual folders pointing to the same physical folder linkd C:\XYZ D:\Projects\Builds\Sources linkd D:\Projects\Builds\XYZProduct2 D:\Projects\Builds\Sources linkd D:\Projects\Builds\XYZProduct5.1.0.10 D:\Projects\Builds\Sources For every new build, we can make a new virtual folder and point it to D:\Projects\Builds\Sources C:\XYZ will always point to this folder anyway. So all builds happen in one folder with the s...

Linkd

We are moving to a new folder structure where we will be using a virtual folder (specifically an “NTFS junction point”) called C:\XYZ instead of the old subst R: drive. The subst R: drive implementation had a lot of issues like no integration with IIS, VSTS2008, TFS Build etc Steps to change: 1. Please remove your existing R: drive “subst r: /D” 2. Remove any .bat file you have for creating the r: drive on startup 3. Install the Windows Server 2003 Resource Kit (even on XP) http://www.microsoft.com/downloads/details.aspx?FamilyID=9d467a69-57ff-4 ae7-96ee-b18c4790cffd&displaylang=en 4. Create the symbolic link (one time only, no bat file required) “linkd C:\XYZ E:\Projects\XYZ” 5. Delete your existing workspace and create a new one with "C:\XYZ" instead of R: as the root folder of your team project.