Biz(Talk)2

Talk, talk and more talk about BizTalk

Add context menu item to Visual Studio

Here’s a nifty way to add a ‘Run in Command Prompt’ context menu item to the Visual Studio solution explorer.

http://www.rickglos.com/post/How-to-run-windows-batch-files-from-Visual-Studio-2010-Solution-Explorer.aspx

Very handy for executing .cmd files to generate .Net type definitions from a BizTalk schema.

Advertisements

May 28, 2013 Posted by | Uncategorized | , | Leave a comment

Replacing an existing TFS user workspace

I recently ran into a situation where I had “inherited” a laptop from a previous developer on a project. This laptop was on the customer’s domain, and had been configured for source control using Team Foundation Services.

A problem arose after logging in using my own credentials, and attempting to map the TFS root (“$/”) to the standard local source root (“C:\TFS”). I was unable to proceed due to the following message:

“The working folder is already in use by the workspace XXXXXXX;firstname.lastname@email.com”

(^^^ where details have been hidden to protect the innocent)

Visual Studio did not provide any mechanism for deleting this existing workspace mapping, however I found a solution by dropping to the command line:


tf workspace /delete /server:OURTFSSERVER\DefaultCollection XXXXXXX;firstname.lastname@email.com

After a confirmation warning that the deleted workspace cannot be recovered, I was able to map my own workspace to the standardised root.

January 21, 2013 Posted by | Uncategorized | , | Leave a comment

Essential plugins for Notepad++

I really, really like Notepad++ as a drop-in replacement for the standard Windows Notepad.

It’s fast, light-weight, can open just about any file format, regardless of encoding or byte-order marks. And best of all, it’s free!

There are a couple of plug-ins that I consider almost essential when developing, especially when working with Xml and Xslt files:

  • XPatherizerNPP – Supports ad-hoc testing of xpath queries against your current document.  Also provides standardised reformatting of an Xml file for readability
  • XML Tools – A host of simple tools, including reformatting, validation against schemas, escaping/un-escaping xml to HTML encoding
  • Regex Helper – Useful for testing out Regular Expressions.  Yes, I know, now I have 2 problems, but when used, and documented, well, a single RegEx can save a lot of coding effort

Notepad++ plug-ins are now fully integrated into the application itself, and these 3 can be installed simply by selecting the master “Plugin Manager” plugin from the drop-down menu.  It’s usually the first thing I do when setting up a new development environment.

Essential++

July 12, 2012 Posted by | Uncategorized | | Leave a comment

Debugging BizTalk instances – which one to attach to?

A good hint from Michael.

Determine the Process Id of a specific BTNTSVC.exe instance using the following command line:

tasklist /svc /fi "imagename eq btsntsvc.exe"

Edit: For mixed 32/64 bit environments, the following will return either type of Host:

tasklist /svc | findstr /i "BTSNTSvc"

 

July 28, 2009 Posted by | Uncategorized | Leave a comment

Adding a Sql user that already exists

Occasionally I’ll need to copy a database over to my dev machine in order to be able to work offline.

USE <Target_Database>
EXEC sp_change_users_login 'Update_One', '<Server_User>', '<Database_User>'

This will re-associate the Server Login with the specified Database Login.

April 28, 2009 Posted by | Uncategorized | Leave a comment

Unlocking a file from TFS

Inevitably somebody on the team goes away on holidays and forgets to check everything into TFS (guilty, as charged!)

There’s no facility to unlock somebody else’s files through TFS Explorer, so we have to resort to the command line.  Firstly, get the list of the user’s workspaces:

tf workspaces /server:tfsserver /owner:DOMAIN\offender /computer:*

This will list the workspaces “owned” by the offending little tyke absent user, which we will feed into the next command:

tf undo /server:tfsserver /workspace:workspacename;DOMAIN\offender $/path/to/file/to/unlock

Now you’re free to change the file at will, and reprimand your teammate when he gets back from his holiday, all tanned and relaxed.

Another FYI: just type in tf on the command line, and it will open up the appropriate help file. Sweet!

March 20, 2009 Posted by | Uncategorized | | Leave a comment

Calling custom stored procedures using CodeSmith

Calling a custom stored procedure using the .NetTiers template in CodeSmith couldn’t be easier. You just make sure your procedure uses the standard naming convention of _{TableName}_{CustomMethodName} and Bam!, your accessor is available on the appropriate Table related class.

However (there’s always a “however”) there is one thing to make sure everything returns nicely.  Make sure the fields returned in your custom stored procedure match up with those in your table, otherwise your custom method will return a generic DataSet.  By returning all the fields from your base table, .NetTiers is smart enough to provide you with a nice, enumerable, TList<myTableEntity> return value.  Handy!

February 11, 2009 Posted by | Uncategorized | | Leave a comment

“Filtering” a document

Just a quick lesson learnt from a recent project, as I know I’m going to need to do this again.

Filtering down an Xml document in a map based on the existance or value of an element or attribute.  For example, say we want to return a copy of a existing document, but only where the optional Status field has a value:

  • Use a map with a Scripting Functoid, using Inline XSLT
  • Use the Xslt copy-of function to make a copy of the source based on a critera selection:
    <xsl:copy-of select="/*[local-name()='RootNodeName']/*[local-name()='Summary'][*[local-name()='Header']/@Status='Active']" />
  • Wire the output of the functoid to the relevant element on the destination schema

January 7, 2009 Posted by | Uncategorized | Leave a comment

Yay, we’re still relevant

Just incase you haven’t read this amongst the other 7394 blog posts today, Microsoft have confirmed the next version of BizTalk Server 2006 R3 2009.

Here’s the official Roadmap page.  Looks like there’s still a lot of life in the old girl yet!

September 16, 2008 Posted by | Uncategorized | Leave a comment

Unable to refresh the BizTalk Group Hub

I have occasionally gotten either of the following errors in my BizTalk Administration console, and am then unable to refresh the BizTalk Group Hub:

"An instance of the FreeThreadedDOMDocument class cannot be created"
"Failed to create a CLSID_BizTalkPropertyBagFactory"

I still don’t know why it happens, but the solution is simple: Restart the Windows WMI Service.

With thanks to this blog article.

September 1, 2008 Posted by | Uncategorized | 1 Comment