Code Snippet: Sort nodes in an Xml Document

Posted at: 7/13/2007 at 4:40 PM by saravana
Scenario: Need to produce a new xml document with particular node list sorted in ascending/descending order Code: XmlDocument xmlDoc = new XmlDocument(); xmlDoc.Load(@"Input.xml"); XmlDocument xmlDocCopy = new XmlDocument(); xmlDocCopy.LoadXml(xmlDoc.OuterXml); xmlDocCopy.SelectSingleNode("//Links").RemoveAll(); XmlNode node = xmlDoc.SelectSingleNode("//Links"); XPathNavigator navigator = node.CreateNavigator(); XPathExpression selectExp... [More]
Tags:  Categories: .NET
Actions: Email this article Email | Kick it! | DZone it! | Save to del.icio.us | Technorati Links
Post Information: Permanent LinkPermalink | CommentsComments(11) | Comments RSS

Determine whether the BizTalk assembly is Debug or Release build at runtime.

Posted at: 6/2/2007 at 7:56 AM by saravana
Recently someone raised this question in the newsgroup, they wanted to branch inside the orchestration based on the build of the assembly itself. Whenever an assembly is build with "Debug" mode, some System.Diagnostics.DebuggableAttributes are added to the assembly. One such attribute is "IsJITTrackingEnabled", which will track information during code generation (MSIL) for the debugger. So, we can use the simple technique of reflection to determine whether the assembly... [More]
Tags:  Categories: .NET | BizTalk General
Actions: Email this article Email | Kick it! | DZone it! | Save to del.icio.us | Technorati Links
Post Information: Permanent LinkPermalink | CommentsComments(11) | Comments RSS

Can't see Debug statements in DebugView?

Posted at: 5/24/2007 at 6:49 AM by saravana
First of all to see debug statements inside DebugView you need to compile your assemblies in "Debug" mode. For optimization reasons if you compile your assemblies in "Release" mode all the System.Diagnostics.Debug.WriteLine statements will be ignored by the compiler and you won't see any output in the DebugView. When it comes to BizTalk project sometimes even though the tool bar will say the build is "Debug" as shown in the figure   When ... [More]
Tags: |  Categories: .NET | BizTalk General
Actions: Email this article Email | Kick it! | DZone it! | Save to del.icio.us | Technorati Links
Post Information: Permanent LinkPermalink | CommentsComments(14) | Comments RSS

Create safe File Name from string using .NET 2.0

Posted at: 5/19/2007 at 10:32 AM by saravana
Recently for one of my weekend project I wanted to create a safe file name from a string. In the past people used to do lot of regular expressions and conditional testing to meet this requirement. Still the filename won't be safe across multiple environments (Windows 2000/XP/2003 etc). But with .NET 2.0 using couple of inbuild functions (Path.GetInvalidFileNameChars and Path.GetInvalidPathChars) you can create safe filenames. Hope this piece of code will be useful to someone. ... [More]
Tags:  Categories: .NET
Actions: Email this article Email | Kick it! | DZone it! | Save to del.icio.us | Technorati Links
Post Information: Permanent LinkPermalink | CommentsComments(5) | Comments RSS

Now, I'm a "MCPD - Enterprise Application Developer for .NET 2.0"

Posted at: 5/15/2007 at 6:58 PM by saravana
I recently obtained my MCPD (Enterprise Applications Developer) credentials. I'll admit probably this is one thing which stayed in my TODO list for more than a year. Microsoft re-organised their certification program after the release of Visual Studio 2005, .NET 2.0 and SQL Server 2005. Not everyone is aware of this new certification model and its requires some explanation here. According to new certification model, the two main categories of certification for people on Softwar... [More]
Tags:  Categories: .NET
Actions: Email this article Email | Kick it! | DZone it! | Save to del.icio.us | Technorati Links
Post Information: Permanent LinkPermalink | CommentsComments(0) | Comments RSS

Detect CLR version under which your BizTalk service is running.

Posted at: 5/12/2007 at 4:44 PM by saravana
It's becoming more and more eminent to understand under which CLR version (1.0, 1.1 or 2.0) the BizTalk runtime, In-Process host is running. I've explained in my previous post the various factors that influence loading appropriate CLR versions and also how you can make use of the config file to force a specific version of CLR is always loaded. There is one more query raised, what happens if you install .NET Framework 3.0 on your BizTalk server (both 2004 and 2006)? The effect of ... [More]
Tags:  Categories: .NET | BizTalk General
Actions: Email this article Email | Kick it! | DZone it! | Save to del.icio.us | Technorati Links
Post Information: Permanent LinkPermalink | CommentsComments(3) | Comments RSS

How to create an invisible .NET Application?

Posted at: 2/5/2007 at 6:35 PM by saravana
Formless application or in my terms invisible .NET applications. I recently end up in a situation where I want to run my console application on a regular schedule via Scheduled task. Problem with that is, it opens ups the schedule every time it runs the application. There were few suggestions in the newsgroups to create a Windows NT service, or WinForms application and make the form invisible etc, etc. None of them were appropriate for me. At last I ended up with a quick and efficie... [More]
Tags:  Categories: .NET
Actions: Email this article Email | Kick it! | DZone it! | Save to del.icio.us | Technorati Links
Post Information: Permanent LinkPermalink | CommentsComments(0) | Comments RSS

Microsoft.BizTalk.Gac.Fusion, Access denied Exception and GAC is empty

Posted at: 1/8/2007 at 7:56 PM by saravana
  Once in a while you get the following error while trying to compile/build the BizTalk project (With few more Access denied errors and some HRESULT values). Error 2 at Microsoft.BizTalk.Gac.Fusion.IAssemblyCache.InstallAssembly(AssemblyCacheInstallFlag flags, String manifestFilePath, FusionInstallReference referenceData) at Microsoft.BizTalk.Gac.Gac.InstallAssembly(String assemblyPathname, Boolean force) at Microsoft.BizTalk.Deployment.BizTalkAssembly.GacInstall(String ... [More]
Tags: | |  Categories: .NET | BizTalk General
Actions: Email this article Email | Kick it! | DZone it! | Save to del.icio.us | Technorati Links
Post Information: Permanent LinkPermalink | CommentsComments(18) | Comments RSS

GAC your assemblies with one click!!

Posted at: 12/19/2006 at 8:04 PM by saravana
  We BizTalk developers often get frustrated with this assembly GACking stuff. Here is a cool registry setting which will make our life little bit easier. Copy and paste the code into a notepad file and save it with extension .reg. Double click on the file and its all done. ------------------------------------------------------- Windows Registry Editor Version 5.00 [HKEY_CLASSES_ROOT\dllfile\shell\GAC-It\command] @="c:\\windows\\Microsoft.NET\\Framework\... [More]
Tags: |  Categories: .NET
Actions: Email this article Email | Kick it! | DZone it! | Save to del.icio.us | Technorati Links
Post Information: Permanent LinkPermalink | CommentsComments(15) | Comments RSS

System.Diagnostics.Process, RedirectStandardOutput process hanging

Posted at: 5/25/2006 at 11:19 AM by saravana
In one of our internal web app's developement, we were executing an console applications with certain arguments synchronously and were trying to display the results in the front-end. When we activate the process I can see the process getting kicked-off in the task manager and it never exits, after a time period (IIS timeout setting), the web app times out. At the end we figured out, the reason is due to an dead lock condition between the parent process (w3wp) and the child process(cons... [More]
Tags:  Categories: .NET
Actions: Email this article Email | Kick it! | DZone it! | Save to del.icio.us | Technorati Links
Post Information: Permanent LinkPermalink | CommentsComments(12) | Comments RSS