<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:copyright="http://blogs.law.harvard.edu/tech/rss" xmlns:image="http://purl.org/rss/1.0/modules/image/">
    <channel>
        <title>BizTalk Server</title>
        <link>http://geekswithblogs.net/socasanta/category/6496.aspx</link>
        <description>BizTalk Server</description>
        <language>en-US</language>
        <copyright>Michael Awai</copyright>
        <managingEditor>Nospamsocasanta@nc.rr.com</managingEditor>
        <generator>Subtext Version 0.0.0.0</generator>
        <item>
            <title>BizTalk 2004, BTSNTSvc.exe, Unable to Attach to Process</title>
            <link>http://geekswithblogs.net/socasanta/archive/2006/04/05/74445.aspx</link>
            <description>&lt;P&gt;&lt;FONT face=Verdana size=2&gt;If you get “Unable to Attach to Process” inside Visual Studio 2003 when trying to attach to a BTSNTSvc.exe process for CLR type debugging, if .NET Framework 2.0 is installed on the machine, add the following to BTSNTSvc.exe.config:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=2&gt;&lt;FONT size=3&gt;&amp;lt;startup&amp;gt;&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT size=3&gt;&amp;lt;requiredRuntime version="v1.1.4322" /&amp;gt;&lt;BR&gt;&amp;lt;/startup&amp;gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;I know I've seen this posted somewhere before, but had a hard time tracking it down again.&amp;nbsp; ...means one more posting is needed IMO.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size=2&gt;&lt;FONT face=Verdana&gt;Later!&lt;/FONT&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=74445"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=74445" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/socasanta/aggbug/74445.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Michael Awai</dc:creator>
            <guid>http://geekswithblogs.net/socasanta/archive/2006/04/05/74445.aspx</guid>
            <pubDate>Thu, 06 Apr 2006 00:40:00 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/socasanta/comments/74445.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/socasanta/archive/2006/04/05/74445.aspx#feedback</comments>
            <slash:comments>1</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/socasanta/comments/commentRss/74445.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/socasanta/services/trackbacks/74445.aspx</trackback:ping>
        </item>
        <item>
            <title>Generate a Sample Instance for any Public, XML Serializable .NET Class Using BizTalk's Instance Generation API</title>
            <link>http://geekswithblogs.net/socasanta/archive/2005/11/07/59353.aspx</link>
            <description>&lt;P&gt;The following code is for quick and dirty command line program that generates an XML instance from an XML-serializable .NET class.&amp;nbsp; It uses BizTalk 2004's instance generation capabilities, so if you happen to find that useful, this code allows you to use it with .NET classes.&amp;nbsp; For example, let's say you have a complex configuration class ServiceConfiguration in assembly c:\whatever\TheSystem.Configuration.dll, and you compile the code below to btsi.exe, the following command will generate a sample instance:&lt;/P&gt;
&lt;P&gt;btsi.exe &amp;#8220;c:\whatever\TheSystem.Configuration.dll&amp;#8221; ServiceConfiguration &amp;#8220;c:\whatever\ServiceConfigurationSample.xml&amp;#8221;&lt;/P&gt;
&lt;P&gt;Here's the code.&amp;nbsp; Just paste it into a console app's default class, add a reference to:&lt;BR&gt;{BizTalkInstallPath}\Developer Tools\Microsoft.BizTalk.TOM.dll &lt;BR&gt;and build.&lt;BR&gt;&lt;BR&gt;It's attrociously commented, but then again, painlessly simple:&lt;BR&gt;&lt;BR&gt;&lt;FONT face="Courier New" color=#000080 size=2&gt;using System;&lt;BR&gt;using System.IO;&lt;BR&gt;using System.Reflection;&lt;BR&gt;using System.Text;&lt;BR&gt;using System.Xml.Serialization;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" color=#000080 size=2&gt;using Microsoft.BizTalk.TOM;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" color=#000080 size=2&gt;namespace btsi&lt;BR&gt;{&lt;BR&gt;&amp;nbsp;/// &lt;SUMMARY&gt;&lt;BR&gt;&amp;nbsp;/// Console application that generates a sample XML instance for a user&lt;BR&gt;&amp;nbsp;/// supplied .NET type.&amp;nbsp; See usage for details.&lt;BR&gt;&amp;nbsp;/// &lt;/SUMMARY&gt;&lt;BR&gt;&amp;nbsp;class Program&lt;BR&gt;&amp;nbsp;{&lt;BR&gt;&amp;nbsp;&amp;nbsp;/// &lt;SUMMARY&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;/// The main entry point for the application.&lt;BR&gt;&amp;nbsp;&amp;nbsp;/// &lt;/SUMMARY&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;[STAThread]&lt;BR&gt;&amp;nbsp;&amp;nbsp;static void Main(string[] args)&lt;BR&gt;&amp;nbsp;&amp;nbsp;{&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;// Check args&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;if(args.Length &amp;lt; 3)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;PrintUsage();&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;System.Environment.Exit(1);&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" color=#000080 size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;// Gather args&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;string sourceAssembly = args[0];&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;string typeName = args[1];&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;string outFile = args[2];&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" color=#000080 size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;// Get schema&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;string schema = GetSchemaFromType(sourceAssembly, typeName);&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Console.WriteLine(schema);&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" color=#000080 size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;// Write instance&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;CreateXmlInstance(schema, outFile);&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" color=#000080 size=2&gt;&amp;nbsp;&amp;nbsp;}&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" color=#000080 size=2&gt;&amp;nbsp;&amp;nbsp;private static void PrintUsage()&lt;BR&gt;&amp;nbsp;&amp;nbsp;{&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;System.Console.WriteLine("Usage: {0} sourceAssembly typeName instanceFilename", Path.GetFileName(System.Reflection.Assembly.GetExecutingAssembly().Location));&lt;BR&gt;&amp;nbsp;&amp;nbsp;}&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" color=#000080 size=2&gt;&amp;nbsp;&amp;nbsp;private static string GetSchemaFromType(string file, string typeName)&lt;BR&gt;&amp;nbsp;&amp;nbsp;{&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;XmlReflectionImporter importer = new XmlReflectionImporter();&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;XmlSchemas schemas = new XmlSchemas();&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;XmlSchemaExporter exporter = new XmlSchemaExporter(schemas);&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" color=#000080 size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;// Enumerate the types, looking for the requested one&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Assembly assem = Assembly.LoadFrom(file);&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Type[] allTypes = assem.GetTypes();&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" color=#000080 size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;for(int i = 0; i &amp;lt; allTypes.Length; i++)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Type t = allTypes[i];&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if(t.IsPublic &amp;amp;&amp;amp; !t.IsInterface)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if (t.FullName == typeName || t.Name == typeName)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;XmlTypeMapping xtm = importer.ImportTypeMapping(t);&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;exporter.ExportTypeMapping(xtm);&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;break;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" color=#000080 size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;StringBuilder sb = new StringBuilder();&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;if(schemas.Count &amp;gt; 0)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;StringWriter sw = new StringWriter(sb);&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;schemas[0].Write(sw);&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;sw.Close();&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" color=#000080 size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;return sb.ToString();&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" color=#000080 size=2&gt;&amp;nbsp;&amp;nbsp;}&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" color=#000080 size=2&gt;&amp;nbsp;&amp;nbsp;private static void CreateXmlInstance(string schema, string outFile)&lt;BR&gt;&amp;nbsp;&amp;nbsp;{&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;string errorString = "";&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" color=#000080 size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;// Load the schema&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Microsoft.BizTalk.TOM.CEditorSchemaTree edTree = new CEditorSchemaTree();&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;edTree.LoadFromString(schema, "", out errorString);&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;edTree.DetermineDisplayRootReferenceOfSchema();&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" color=#000080 size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;InstanceGenerationOptions igo = new InstanceGenerationOptions();&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;igo.CycleExpansionDepth = 0;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;igo.MaxNodeCount = 0;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;igo.UseNativeExtension = false;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;ITOMErrorInfo[] errors = null; &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" color=#000080 size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;// Write the instance&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;edTree.CreateXMLInstance(outFile, igo, out errors);&lt;BR&gt;&amp;nbsp;&amp;nbsp;}&lt;BR&gt;&amp;nbsp;&lt;BR&gt;&amp;nbsp;}&lt;BR&gt;}&lt;BR&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=59353"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=59353" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/socasanta/aggbug/59353.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Michael Awai</dc:creator>
            <guid>http://geekswithblogs.net/socasanta/archive/2005/11/07/59353.aspx</guid>
            <pubDate>Mon, 07 Nov 2005 16:50:00 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/socasanta/comments/59353.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/socasanta/archive/2005/11/07/59353.aspx#feedback</comments>
            <slash:comments>1</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/socasanta/comments/commentRss/59353.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/socasanta/services/trackbacks/59353.aspx</trackback:ping>
        </item>
    </channel>
</rss>