<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>Inside Microsoft Dynamics CRM 3.0</title>
        <link>http://geekswithblogs.net/insidemscrm/Default.aspx</link>
        <description>Arne Janning</description>
        <language>en-US</language>
        <copyright>Arne Janning</copyright>
        <managingEditor>iasyncresult@gmail.com</managingEditor>
        <generator>Subtext Version 0.0.0.0</generator>
        <image>
            <title>Inside Microsoft Dynamics CRM 3.0</title>
            <url>http://geekswithblogs.net/images/RSS2Image.gif</url>
            <link>http://geekswithblogs.net/insidemscrm/Default.aspx</link>
            <width>77</width>
            <height>60</height>
        </image>
        <item>
            <title>Hello World</title>
            <link>http://geekswithblogs.net/insidemscrm/archive/2005/11/07/59351.aspx</link>
            <description>&lt;TABLE&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD&gt;&lt;A href="http://img227.imageshack.us/my.php?image=arnejanning7rl.jpg" target=_blank&gt;&lt;/A&gt;&lt;/TD&gt;
&lt;TD vAlign=top&gt;Hi. My name is Arne Janning, I live in Heidelberg, Germany, and I am a programmer. This Blog is about&amp;nbsp;programming, extending, hacking, deploying and integrating&amp;nbsp;Microsoft Dynamics CRM 3.0. &lt;BR&gt;&lt;BR&gt;Nuff said!&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=59351"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=59351" 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/insidemscrm/aggbug/59351.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Arne Janning</dc:creator>
            <guid>http://geekswithblogs.net/insidemscrm/archive/2005/11/07/59351.aspx</guid>
            <pubDate>Mon, 07 Nov 2005 22:33:00 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/insidemscrm/comments/59351.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/insidemscrm/archive/2005/11/07/59351.aspx#feedback</comments>
            <slash:comments>7</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/insidemscrm/comments/commentRss/59351.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/insidemscrm/services/trackbacks/59351.aspx</trackback:ping>
        </item>
        <item>
            <title>Getting inside Microsoft CRM - Part I</title>
            <link>http://geekswithblogs.net/insidemscrm/archive/2006/01/28/67397.aspx</link>
            <description>&lt;P&gt;&lt;FONT face=Arial&gt;So... I didn't post for a long time, I have been on holidays since new year, didn't have an internet connection for a long time - I actually write this from an internet cafe.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial&gt;In my &lt;/FONT&gt;&lt;A href="http://geekswithblogs.net/insidemscrm/archive/2005/11/16/60313.aspx"&gt;&lt;FONT face=Arial&gt;last post&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Arial&gt;&amp;nbsp;I promised to show how to get inside CRM and do customizations that go far beyond of what is supported. I also already mentioned the main entry point of the whole CRM-web-application, which is the Microsoft.Crm.MainApplication.Application_OnStart()-method in Microsoft.Crm.Application.Pages.dll. Microsoft.Crm.MainApplication is referenced in the global.asax-file in the CRM-webroot: &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;&amp;lt;%@ Application language="c#" Inherits="Microsoft.Crm.MainApplication" CodeBehind="Microsoft.Crm.Application.Pages.dll"%&amp;gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;&lt;%@ Application language="c#" Inherits="Microsoft.Crm.MainApplication" CodeBehind="Microsoft.Crm.Application.Pages.dll"%&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;&lt;%@ Application language="c#" Inherits="Microsoft.Crm.MainApplication" CodeBehind="Microsoft.Crm.Application.Pages.dll"%&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;%@ Application language="c#" Inherits="Microsoft.Crm.MainApplication.Application" CodeBehind="Microsoft.Crm.Application.Pages.dll"%&gt;&lt;FONT face=Arial&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial&gt;We will write our own CRM-host to get inside CRM and get access to the internal CRM-object model at runtime. This is fairly easy.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial&gt;First of all, create class library project in Visual Studio .NET 2003 - it must be .NET 1.1. In my example the project has the name "Janning.Crm.Host".&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial&gt;Then&amp;nbsp;make sure you&amp;nbsp;have added the following&amp;nbsp;references:&lt;/FONT&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;FONT face=Arial&gt;System.dll &lt;/FONT&gt;
&lt;LI&gt;&lt;FONT face=Arial&gt;System.Data.dll &lt;/FONT&gt;
&lt;LI&gt;&lt;FONT face=Arial&gt;System.XML.dll &lt;/FONT&gt;
&lt;LI&gt;&lt;FONT face=Arial&gt;System.Drawing.dll &lt;/FONT&gt;
&lt;LI&gt;&lt;FONT face=Arial&gt;System.Web.dll &lt;/FONT&gt;
&lt;LI&gt;&lt;FONT face=Arial&gt;Microsoft.Crm.dll (from the GAC) &lt;/FONT&gt;
&lt;LI&gt;&lt;FONT face=Arial&gt;Microsoft.Crm.Application.Components.Application.dll (from &lt;CRMWEBROOT&gt;\bin) &lt;/FONT&gt;
&lt;LI&gt;&lt;FONT face=Arial&gt;Microsoft.Crm.Application.Components.Core.dll (from &lt;CRMWEBROOT&gt;\bin) &lt;/FONT&gt;
&lt;LI&gt;&lt;FONT face=Arial&gt;Microsoft.Crm.Application.Components.Platform.dll (from &lt;CRMWEBROOT&gt;\bin) &lt;/FONT&gt;
&lt;LI&gt;&lt;FONT face=Arial&gt;Microsoft.Crm.Platform.Sdk.dll (from the GAC)&lt;/FONT&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;&lt;FONT face=Arial&gt;There is a small trick to copy assemblies from the GAC : Press Start --&amp;gt; Run and then enter C:\Windows\assembly\gac. The shell extension which is normally running on the assembly-folder won't show up then and you can easily copy and paste the CRM-assemblies and reference them from VS.NET.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial&gt;Then you have to add the following code into a codefile:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;using System;&lt;BR&gt;using System.Collections;&lt;BR&gt;using System.ComponentModel;&lt;BR&gt;using System.Configuration;&lt;BR&gt;using System.Diagnostics;&lt;BR&gt;using System.Globalization;&lt;BR&gt;using System.IO;&lt;BR&gt;using System.Runtime.InteropServices;&lt;BR&gt;using System.Reflection;&lt;BR&gt;using System.Security.Principal;&lt;BR&gt;using System.Web;&lt;BR&gt;using System.Web.SessionState;&lt;BR&gt;using System.Xml;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;using Microsoft.Crm;&lt;BR&gt;using Microsoft.Crm.Application.Platform;&lt;BR&gt;using Microsoft.Crm.Errors;&lt;BR&gt;using Microsoft.Crm.Metadata;&lt;BR&gt;using Microsoft.Crm.Security;&lt;BR&gt;using Microsoft.Crm.Utility;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;namespace Janning.Crm.Host&lt;BR&gt;{&lt;BR&gt;&amp;nbsp;public class CustomCrmApplicationHost : HttpApplication&lt;BR&gt;&amp;nbsp;{&lt;BR&gt;&amp;nbsp;&amp;nbsp;protected void Application_Start(Object sender, EventArgs e)&lt;BR&gt;&amp;nbsp;&amp;nbsp;{&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;RegControl.LoadLibraries();&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;NotificationManager.ExtraParameter = HttpContext.Current;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;MetadataCacheConfig.LoadMethod = LoadMethod.Database;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;NotificationManager.StartNotificationsThread(new Notification());&lt;BR&gt;&amp;nbsp;&amp;nbsp;}&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;&amp;nbsp;&amp;nbsp;protected void Application_AuthenticateRequest(Object sender, EventArgs e)&lt;BR&gt;&amp;nbsp;&amp;nbsp;{&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;try&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;UserCache.GetCurrentUser();&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;catch (Exception ex)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;COMException comex = ex as COMException;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;string errorCode = "0xffffffff";&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if (comex != null)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;errorCode = comex.ErrorCode.ToString("x", CultureInfo.InvariantCulture);&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;string redirectPath = string.Format(&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;CultureInfo.InvariantCulture, &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;"/_common/error/authenticationError.htm?0x{0}&amp;amp;{1}", &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;errorCode, &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;base.Request.Url.AbsoluteUri);&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;base.Response.Redirect(redirectPath);&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;base.Response.End();&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;CrmTrace.TraceFormat(&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;TraceCategory.Application, &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;TraceLevel.Error, &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;"An error occurred during the Application_OnAuthenticateRequest : \nError: {0} \nStack Trace:{1}", &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ex.Message, &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ex.StackTrace);&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;BR&gt;&amp;nbsp;&amp;nbsp;}&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;&amp;nbsp;&amp;nbsp;protected void Application_Error(Object sender, EventArgs e)&lt;BR&gt;&amp;nbsp;&amp;nbsp;{&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;base.Response.Clear();&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Exception ex = base.Server.GetLastError();&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;ErrorInformation info = new ErrorInformation(ex, base.Request.Url);&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;if (ConfigurationSettings.AppSettings["DevErrors"] != "On")&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;info.StackTrace = string.Empty;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;if (info.Source == "XML")&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;base.Response.ContentType = "text/xml";&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ErrorInformation.XmlSerializer.Serialize(base.Response.OutputStream, info);&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;base.Response.End();&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;else if (info.Source == "SOAP")&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;base.Response.Clear();&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;base.Response.ContentType = "text/xml";&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;base.Response.StatusCode = 500;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;XmlTextWriter writer = new XmlTextWriter(base.Response.Output);&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;writer.WriteStartDocument();&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;writer.WriteStartElement("soap", "Envelope", "&lt;/FONT&gt;&lt;A href="http://schemas.xmlsoap.org/soap/envelope/"&gt;&lt;FONT face="Courier New"&gt;http://schemas.xmlsoap.org/soap/envelope/&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face="Courier New"&gt;");&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;writer.WriteStartElement("Body", "&lt;/FONT&gt;&lt;A href="http://schemas.xmlsoap.org/soap/envelope/"&gt;&lt;FONT face="Courier New"&gt;http://schemas.xmlsoap.org/soap/envelope/&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face="Courier New"&gt;");&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;writer.WriteStartElement("Fault", "&lt;/FONT&gt;&lt;A href="http://schemas.xmlsoap.org/soap/envelope/"&gt;&lt;FONT face="Courier New"&gt;http://schemas.xmlsoap.org/soap/envelope/&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face="Courier New"&gt;");&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;writer.WriteElementString("faultcode", "Server");&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;writer.WriteElementString("faultstring", info.Description);&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;writer.WriteStartElement("detail");&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ErrorInformation.XmlSerializer.Serialize(writer, info);&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;writer.WriteEndDocument();&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;base.Response.End();&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;else&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;HttpException httpEx = ex as HttpException;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;string maxRequestLenghText = "Maximum request length exceeded.";&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;string pathFileName = Path.GetFileName(base.Request.Path);&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if ((pathFileName == "print_data.aspx") || (base.Request.Path == "/crmreports/download.aspx"))&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;base.Response.ClearHeaders();&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if ((pathFileName == "importFieldMap.aspx") &amp;amp;&amp;amp; (httpEx.ErrorCode == -2147467259) &amp;amp;&amp;amp; ((ex.InnerException != null) ? (maxRequestLenghText == ex.InnerException.Message) : true))&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;base.Server.ClearError();&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;base.Response.Redirect("/Tools/BulkImport/importFileChoose.aspx?errorMessage=BulkImport_Error_Exceed_MaxFileSize");&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;base.Response.End();&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;else if ((pathFileName == "upload.aspx") &amp;amp;&amp;amp; (httpEx.ErrorCode == -2147467259))&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;base.Server.ClearError();&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;base.Response.Redirect("/_common/error/uploadFailure.aspx?hr=0x80043e08");&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;base.Response.End();&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;else if (pathFileName == "print_data.aspx")&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;base.Server.ClearError();&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;base.Response.Redirect("/_common/error/popuperror.aspx?hr=" + &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; httpEx.ErrorCode.ToString());&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;base.Response.End();&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;else if (ConfigurationSettings.AppSettings["DevErrors"] == "On")&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//left this out for the moment&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;else&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;base.Response.Redirect(&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;"/_common/error/errorhandler.aspx?errNum=" + &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;HttpUtility.UrlEncode(info.Code) + &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;"&amp;amp;errMessage=" + &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;HttpUtility.UrlEncode(info.Description));&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;base.Response.End();&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;BR&gt;&amp;nbsp;&amp;nbsp;}&lt;BR&gt;&amp;nbsp;}&lt;BR&gt;}&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial&gt;Compile the code into an assembly, copy the assembly into the &lt;CRMWEBROOT&gt;\bin-folder, make a backup of the global.asax-file and change the global.asax-file to this:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size=4&gt;&amp;lt;%@ Application language="c#" Inherits="Janning.Crm.Host.CustomCrmApplicationHost" CodeBehind="Janning.Crm.Host.dll"%&amp;gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size=4&gt;&lt;%@ Application language="c#" Inherits="Janning.Crm.Host.CustomCrmApplicationHost" CodeBehind="Janning.Crm.Host.dll"%&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;&lt;%@ Application language="c#" Inherits="Janning.Crm.Host.CustomCrmApplicationHost" CodeBehind="Janning.Crm.Host.dll"%&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;%@ Application language="c#" Inherits="Janning.Crm.Host.CustomCrmApplicationHost" CodeBehind="Janning.Crm.Host.dll"%&gt;&lt;FONT face=Arial&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial&gt;(If your assembly-name or namespace is different you have to&amp;nbsp;change this of course)&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial&gt;Make an iisreset (Start --&amp;gt; Run --&amp;gt; iisreset) and open CRM again: http://yourCrmServerOrIP&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial&gt;Everything just works exactly like it did before, there is only one difference: if you use a tool like &lt;/FONT&gt;&lt;A href="http://www.sysinternals.com/Utilities/ProcessExplorer.html"&gt;&lt;FONT face=Arial&gt;Process Explorer&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Arial&gt;&amp;nbsp;and look which dlls are loaded into the w3wp.exe-process you'll see that the Janning.Crm.Host.dll is actually running in the process. As the code in this assembly which is running in the most central part of CRM is now completely under your control you can do pretty much anything - if you know the internal object model. I'll&amp;nbsp;write about this soon&amp;nbsp;in detail and&amp;nbsp;give you a couple of examples.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial&gt;I should mention again that all this is of course completely unsupported by Microsoft, me or my future employer.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial&gt;If someone wants to have the complete VS.NET-solution-files then just leave a comment here and I'll send it via email. I have no access to an FTP-server at the moment so I can't offer a download - perhaps someone has some empty space for me? :-)&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial&gt;(And please, could somebody explain me how to use the font sizes in .Text-Admin - I simply don't get it)&lt;/FONT&gt;&lt;/P&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=67397"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=67397" 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/insidemscrm/aggbug/67397.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Arne Janning</dc:creator>
            <guid>http://geekswithblogs.net/insidemscrm/archive/2006/01/28/67397.aspx</guid>
            <pubDate>Sat, 28 Jan 2006 21:35:00 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/insidemscrm/comments/67397.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/insidemscrm/archive/2006/01/28/67397.aspx#feedback</comments>
            <slash:comments>62</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/insidemscrm/comments/commentRss/67397.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/insidemscrm/services/trackbacks/67397.aspx</trackback:ping>
        </item>
        <item>
            <title>Enable tracing in Microsoft Dynamics CRM 3.0</title>
            <link>http://geekswithblogs.net/insidemscrm/archive/2005/11/16/60313.aspx</link>
            <description>&lt;P&gt;So let's simply start this blog. &lt;/P&gt;
&lt;P&gt;One of my goals is to show how one can inject custom code in CRM 3.0 - I'm not talking about callouts or supported and documented stuff (of course I will write about this as well on this blog) - I'm talking about changing the internal objects and data structures at runtime.&lt;/P&gt;
&lt;P&gt;To that end we will have to look a lot at the code &lt;A href=http://www.aisto.com/roeder/dotnet target=_blank&gt;Reflector&lt;/A&gt; gives us, to see what's really going on under the hood. To that same end - and for many other things - using the built-in tracing-mechanism is really useful to see what MSCRM actually does. &lt;/P&gt;
&lt;P&gt;Although there is a section "Registry Settings" in the &lt;A href=http://www.microsoft.com/downloads/details.aspx?FamilyID=9c178b68-3a06-4898-bc83-bd14b74308c5 target=_blank&gt;SDK&lt;/A&gt; it is not documented how to enable tracing.&lt;/P&gt;
&lt;P&gt;But &lt;A href="http://www.aisto.com/roeder/dotnet"&gt;Reflector&lt;/A&gt; shows that there is a class called CrmTrace in Microsoft.Crm.dll. The method Microsoft.Crm.CrmTrace.LoadTrace() : Boolean shows the registry keys that are necessary to enable tracing:&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#1000a0&gt;private&lt;/FONT&gt; &lt;FONT color=#1000a0&gt;static&lt;/FONT&gt; &lt;A title=System.Boolean href=http://www.aisto.com/roeder/dotnet/ target=_blank&gt;&lt;FONT color=#006018&gt;bool&lt;/FONT&gt;&lt;/A&gt; &lt;B&gt;LoadTrace&lt;/B&gt;()&lt;BR&gt;{&lt;BR&gt;      &lt;A title=System.String href="http://www.aisto.com/roeder/dotnet/Default.aspx?Object=2"&gt;&lt;FONT color=#006018&gt;string&lt;/FONT&gt;&lt;/A&gt;[] &lt;B&gt;textArray2&lt;/B&gt;;&lt;BR&gt;     //[...]&lt;BR&gt;     &lt;A title="string[] textArray2 // Local Variable"&gt;&lt;FONT color=#006018&gt;textArray2&lt;/FONT&gt;&lt;/A&gt; = &lt;FONT color=#1000a0&gt;new&lt;/FONT&gt; &lt;A title=System.String href="http://www.aisto.com/roeder/dotnet/Default.aspx?Object=19"&gt;&lt;FONT color=#006018&gt;string&lt;/FONT&gt;&lt;/A&gt;[] { &lt;FONT color=#800000&gt;"TraceEnabled"&lt;/FONT&gt;, &lt;FONT color=#800000&gt;"TraceSchedule"&lt;/FONT&gt;, &lt;FONT color=#800000&gt;"TraceCallStack"&lt;/FONT&gt;, &lt;FONT color=#800000&gt;"TraceCategories"&lt;/FONT&gt; } ;&lt;BR&gt;     //[...]&lt;BR&gt;     &lt;A title="string text1 // Local Variable"&gt;&lt;FONT color=#006018&gt;text1&lt;/FONT&gt;&lt;/A&gt; = &lt;FONT color=#800000&gt;"TraceEnabled"&lt;/FONT&gt;;&lt;BR&gt;     &lt;A title=Microsoft.Crm.CrmTrace href="http://www.aisto.com/roeder/dotnet/Default.aspx?Object=30"&gt;&lt;FONT color=#006018&gt;CrmTrace&lt;/FONT&gt;&lt;/A&gt;.&lt;A title="bool Microsoft.Crm.CrmTrace.isTracingOff;" href="http://www.aisto.com/roeder/dotnet/Default.aspx?Object=31"&gt;&lt;FONT color=#006018&gt;isTracingOff&lt;/FONT&gt;&lt;/A&gt; = ((&lt;A title=System.Int32 href="http://www.aisto.com/roeder/dotnet/Default.aspx?Object=32"&gt;&lt;FONT color=#006018&gt;int&lt;/FONT&gt;&lt;/A&gt;) &lt;A title=Microsoft.Crm.RegistryCache href="http://www.aisto.com/roeder/dotnet/Default.aspx?Object=33"&gt;&lt;FONT color=#006018&gt;RegistryCache&lt;/FONT&gt;&lt;/A&gt;.&lt;A title="object Microsoft.Crm.RegistryCache.GetValue(string key);" href="http://www.aisto.com/roeder/dotnet/Default.aspx?Object=34"&gt;&lt;FONT color=#006018&gt;GetValue&lt;/FONT&gt;&lt;/A&gt;(&lt;FONT color=#800000&gt;"TraceEnabled"&lt;/FONT&gt;)) == &lt;FONT color=#800000&gt;0&lt;/FONT&gt;;&lt;BR&gt;     //[...]&lt;BR&gt;&lt;/P&gt;
&lt;P&gt; &lt;/P&gt;
&lt;P&gt;So to enable the tracing-mechanism you simply have to add some registry keys to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSCRM:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;TraceEnabled (dword) - set the value to 1 to turn on tracing, set the value to 0 to turn it off again 
&lt;LI&gt;TraceDirectory (string) - this is the directory where the trace files are stored. The directory has to exist, CRM will not create the directory. 
&lt;LI&gt;TraceCategories (string) - set the value to *:Verbose 
&lt;LI&gt;TraceCallStack (dword) - set the value to 1 if your're interested in the stack trace 
&lt;LI&gt;TraceRefresh (dword) - set the value to 1 
&lt;LI&gt;TraceSchedule (string) - set it to one of the values of the Microsoft.Crm.TraceSchedule-enum: e.g. Daily or Hourly&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;It is not necessary to restart IIS, MSCRM 3.0 has a mechanism of getting notified of configuration-changes at runtime. This mechanism gets started by the Microsoft.Crm.MainApplication.Application_OnStart()-method in Microsoft.Crm.Application.Pages.dll:&lt;/P&gt;
&lt;P&gt;&lt;A title=Microsoft.Crm.NotificationManager href="http://www.aisto.com/roeder/dotnet/Default.aspx?Object=12"&gt;&lt;FONT color=#006018&gt;NotificationManager&lt;/FONT&gt;&lt;/A&gt;.&lt;A title="void Microsoft.Crm.NotificationManager.StartNotificationsThread(INotificationsProvider);" href="http://www.aisto.com/roeder/dotnet/Default.aspx?Object=13"&gt;&lt;FONT color=#006018&gt;StartNotificationsThread&lt;/FONT&gt;&lt;/A&gt;(&lt;FONT color=#1000a0&gt;new&lt;/FONT&gt; &lt;A title=Microsoft.Crm.Application.Platform.Notification.Notification(); href="http://www.aisto.com/roeder/dotnet/Default.aspx?Object=14"&gt;&lt;FONT color=#006018&gt;Notification&lt;/FONT&gt;&lt;/A&gt;());&lt;BR&gt;&lt;/P&gt;
&lt;P&gt;Microsoft.Crm.MainApplication.Application_OnStart() is the main entrypoint for the whole MSCRM-application. We will speak about this later in much greater detail.&lt;/P&gt;
&lt;P&gt;To be continued...&lt;/P&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=60313"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=60313" 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/insidemscrm/aggbug/60313.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Arne Janning</dc:creator>
            <guid>http://geekswithblogs.net/insidemscrm/archive/2005/11/16/60313.aspx</guid>
            <pubDate>Wed, 16 Nov 2005 23:24:00 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/insidemscrm/comments/60313.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/insidemscrm/archive/2005/11/16/60313.aspx#feedback</comments>
            <slash:comments>4</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/insidemscrm/comments/commentRss/60313.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/insidemscrm/services/trackbacks/60313.aspx</trackback:ping>
        </item>
    </channel>
</rss>