<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Sitecore Xperiences &#187; Sitecore 9</title>
	<atom:link href="https://blog.peplau.com.br/category/sitecore-9/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.peplau.com.br</link>
	<description>The things I&#039;ve seen as a Sitecore Professional</description>
	<lastBuildDate>Sun, 09 Mar 2025 21:54:22 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=4.1.41</generator>
	<item>
		<title>Malformed querystring breaks Sitecore Experience Forms (Value cannot be null. Parameter name: key)</title>
		<link>https://blog.peplau.com.br/value-cannot-be-null-parameter-name-key-malformed-querystring-breaks-sitecore-experience-forms/</link>
		<comments>https://blog.peplau.com.br/value-cannot-be-null-parameter-name-key-malformed-querystring-breaks-sitecore-experience-forms/#comments</comments>
		<pubDate>Wed, 05 Feb 2020 22:00:09 +0000</pubDate>
		<dc:creator><![CDATA[Rodrigo Peplau]]></dc:creator>
				<category><![CDATA[Experience Forms]]></category>
		<category><![CDATA[Sitecore 9]]></category>

		<guid isPermaLink="false">http://blog.peplau.com.br/?p=805</guid>
		<description><![CDATA[<div class="lr_horizontal_share" data-share-url="https://blog.peplau.com.br/value-cannot-be-null-parameter-name-key-malformed-querystring-breaks-sitecore-experience-forms/"></div>We noticed a bug in Sitecore Experience Forms 9.0.2: when you access a page that has a form passing wrong query string parameters, the system responds with a Runtime Error. The Error&#8230; For instance, the following url: ==&#62; http://local.myclient.com/myform?good=1&#38;bad Because the query string parameter &#8220;bad&#8221; does not have a corresponding value, accessing this page will result in a error [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>We noticed a bug in Sitecore Experience Forms 9.0.2: when you access a page that has a form passing wrong query string parameters, the system responds with a Runtime Error.</p>
<h2>The Error&#8230;</h2>
<p>For instance, the following url:<br />
==&gt; http://local.myclient.com/myform?good=1<strong>&amp;bad</strong></p>
<p>Because the query string parameter &#8220;bad&#8221; does not have a corresponding value, accessing this page will result in a error like this:</p>
<h1>Server Error in &#8216;/&#8217; Application.</h1>
<hr size="1" width="100%" />
<h2><i>Value cannot be null.<br />
Parameter name: key</i></h2>
<p><span style="font-family: Arial, Helvetica, Geneva, SunSans-Regular, sans-serif;"><b>Description: </b>An unhandled exception occurred.</span></p>
<p><b>Exception Details: </b>System.ArgumentNullException: Value cannot be null.<br />
Parameter name: key</p>
<p><b>Source Error:</b></p>
<table width="100%" bgcolor="#ffffcc">
<tbody>
<tr>
<td><code>An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.</code></td>
</tr>
</tbody>
</table>
<p><span style="font-family: Arial, Helvetica, Geneva, SunSans-Regular, sans-serif;"><br />
<b>Stack Trace:</b><br />
</span></p>
<table width="100%" bgcolor="#ffffcc">
<tbody>
<tr>
<td>
<pre>[ArgumentNullException: Value cannot be null.
Parameter name: key]
   System.ThrowHelper.ThrowArgumentNullException(ExceptionArgument argument) +49
   System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add) +14789605
   System.Linq.Enumerable.ToDictionary(IEnumerable`1 source, Func`2 keySelector, Func`2 elementSelector, IEqualityComparer`1 comparer) +283
   Sitecore.ExperienceForms.Mvc.Pipelines.RenderForm.SetFormParameters.Process(RenderFormEventArgs args) +639
   (Object , Object ) +14
   Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args) +484
   Sitecore.Pipelines.DefaultCorePipelineManager.Run(String pipelineName, PipelineArgs args, String pipelineDomain, Boolean failIfNotExists) +236
   Sitecore.Pipelines.DefaultCorePipelineManager.Run(String pipelineName, PipelineArgs args, String pipelineDomain) +22
   Sitecore.Mvc.Pipelines.PipelineService.RunPipeline(String pipelineName, TArgs args) +195
   Sitecore.Mvc.Pipelines.PipelineService.RunPipeline(String pipelineName, TArgs args, Func`2 resultGetter) +161
   Sitecore.ExperienceForms.Mvc.Html.HtmlExtensions.BeginRenderRouteForm(HtmlHelper htmlHelper, FormViewModel model, Boolean isPost) +301
   ASP._Views_FormBuilder_Form_cshtml.Execute() in D:\Git\ADMI\src\Feature\ADMI.Jobs\Forms\code\obj\CodeGen\Views\FormBuilder\Form.cshtml:6
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy() +252
   System.Web.Mvc.WebViewPage.ExecutePageHierarchy() +148
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) +122
   System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context) +375
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +88
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +775
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +775
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +775
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList`1 filters, ActionResult actionResult) +81
   System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) +701
</pre>
</td>
</tr>
</tbody>
</table>
<p><b>Version Information:</b> Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.7.3282.0</p>
<hr />
<p>&nbsp;</p>
<h2>&#8230;The root cause&#8230;</h2>
<p>Decompiling the &#8220;Sitecore.ExperienceForms.Mvc.dll&#8221; shows exactly where the issue happens: one of the processors at the &lt;forms.renderForm&gt;, more precisely the &#8220;Sitecore.ExperienceForms.Mvc.Pipelines.RenderForm.SetFormParameters&#8221; processor, is missing a simple null check.</p>
<p>&nbsp;</p>
<h2>&#8230;And the fix!</h2>
<p>Of course, I have tried to extend the original class, to apply my fix in a more &#8220;surgical&#8221; way. However, due to a private property, we will need to re-implement the whole class.</p>
<p>The fix is very simple and will only require a class and a config patch.</p>
<h3>STEP 1 &#8211; Create the new SetFormParameters processor</h3>
<p>Here is how your processor class should look like. The code is fully commented to show exactly what has been modified and what is simply copied/pasted from the original class.</p>
<pre>using System.Collections.Generic;
using System.Linq;
using System.Web.Routing;
using Sitecore.Diagnostics;
using Sitecore.ExperienceForms;
using Sitecore.ExperienceForms.Mvc.Pipelines.RenderForm;
using Sitecore.Mvc.Configuration;
using Sitecore.Mvc.Pipelines;

namespace MyProject.Pipelines.Forms
{
 /// &lt;summary&gt;
 /// Pipeline that implements a fix for Sitecore.ExperienceForms.Mvc.Pipelines.RenderForm.SetFormParameters
 /// The fix is basically a null check in a LINQ expression, but due to a private property
 /// we are forced to re-implement the whole class in order apply the fix
 /// &lt;/summary&gt;
 public class SetFormParameters : MvcPipelineProcessor&lt;RenderFormEventArgs&gt;
 {
    /// &lt;summary&gt;
    /// This is the private property that we need to re-implement
    /// &lt;/summary&gt;
    private readonly IQueryStringProvider _queryStringProvider;

    /// &lt;summary&gt;
    /// Constructor is identical to the original class
    /// &lt;/summary&gt;
    /// &lt;param name="queryStringProvider"&gt;&lt;/param&gt;
    public SetFormParameters(IQueryStringProvider queryStringProvider)
    {
       Assert.ArgumentNotNull((object) queryStringProvider, nameof (queryStringProvider));
       this._queryStringProvider = queryStringProvider;
    }

    /// &lt;summary&gt;
    /// This is where the fix is applied - whole method is identical to original
    /// except for the LINQ expression in the end of the file
    /// &lt;/summary&gt;
    /// &lt;param name="args"&gt;&lt;/param&gt;
    public override void Process(RenderFormEventArgs args)
    {
       Assert.ArgumentNotNull((object) args, nameof (args));
       args.FormHtmlId = args.HtmlHelper.AttributeEncode(args.HtmlHelper.ViewData.TemplateInfo.GetFullHtmlFieldId(args.ViewModel.ItemId));
       args.Attributes = new Dictionary&lt;string, object&gt;()
       {
          {
             "enctype",
             (object) "multipart/form-data"
          },{
             "id",
             (object) args.FormHtmlId
          },{
             "data-sc-fxb",
             (object) args.ViewModel.ItemId
          }
       };
       if (!string.IsNullOrEmpty(args.ViewModel.CssClass))
          args.Attributes.Add("class", args.ViewModel.CssClass);
       args.QueryString = new RouteValueDictionary(
          _queryStringProvider.QueryParameters.AllKeys
             .Where(p=&gt;p!=null) // &lt;--- The fix itself is here
             .ToDictionary(key =&gt; key,
                key =&gt; (object) _queryStringProvider.QueryParameters[key]));
                args.RouteName = MvcSettings.SitecoreRouteName;
    }
 }
}

</pre>
<h3>STEP 2 &#8211; Register your processor to make it load instead of the original one</h3>
<p>And of course, let&#8217;s register the processor using the following config patch:</p>
<pre>&lt;configuration xmlns:patch="http://www.sitecore.net/xmlconfig/"&gt;
 &lt;sitecore&gt;
 
 &lt;forms.renderForm&gt;
 &lt;processor type="MyProject.Pipelines.Forms.SetFormParameters, MyProject" resolve="true" 
 patch:instead="processor[@type='Sitecore.ExperienceForms.Mvc.Pipelines.RenderForm.SetFormParameters, Sitecore.ExperienceForms.Mvc']"/&gt;
 &lt;/forms.renderForm&gt;

 &lt;/pipelines&gt;
 &lt;/sitecore&gt;
&lt;/configuration&gt;</pre>
<p>&nbsp;</p>
<h2>Is this officially recognized as a bug?</h2>
<p>Yes, it a known bug, registered with the public reference number 324457 (More information about public reference numbers can be found here: <a href="https://kb.sitecore.net/articles/853187">https://kb.sitecore.net/articles/853187</a>)</p>
<p>This bug was resolved in <strong>Sitecore 9.3</strong>, as can be seen in the release notes:<br />
<a href="https://dev.sitecore.net/Downloads/Sitecore%20Experience%20Platform/93/Sitecore%20Experience%20Platform%2093%20Initial%20Release/Release%20Notes">https://dev.sitecore.net/Downloads/Sitecore%20Experience%20Platform/93/Sitecore%20Experience%20Platform%2093%20Initial%20Release/Release%20Notes</a></p>
<p>&nbsp;</p>
<blockquote><p>&#8220;​​​​If you use a query string that contains parameter without a value to open a page that contains a form, the form is not rendered​.&#8221;</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>https://blog.peplau.com.br/value-cannot-be-null-parameter-name-key-malformed-querystring-breaks-sitecore-experience-forms/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Still have &#039;ERROR SCRIPTDOM NEEDED FOR SQL PROVIDER&#039; when installing Sitecore 9?</title>
		<link>https://blog.peplau.com.br/still-have-error_scriptdom_needed_for_sql_provider-when-installing-sitecore-9/</link>
		<comments>https://blog.peplau.com.br/still-have-error_scriptdom_needed_for_sql_provider-when-installing-sitecore-9/#comments</comments>
		<pubDate>Thu, 11 Jan 2018 18:22:24 +0000</pubDate>
		<dc:creator><![CDATA[Rodrigo Peplau]]></dc:creator>
				<category><![CDATA[SIF]]></category>
		<category><![CDATA[Sitecore 9]]></category>

		<guid isPermaLink="false">http://blog.peplau.com.br/?p=677</guid>
		<description><![CDATA[<div class="lr_horizontal_share" data-share-url="https://blog.peplau.com.br/still-have-error_scriptdom_needed_for_sql_provider-when-installing-sitecore-9/"></div>My friend Daniel Govier was having the following error when installing Sitecore 9 Update 1 using XP0:

msdeploy.exe : Error Code: ERROR_SCRIPTDOM_NEEDED_FOR_SQL_PROVIDER

Following the traditional path of any Sitecore developer, we googled that error and ended up in this blog article from Naveed Ahmad. Problem is that Daniel had already followed his article and installed SQL Server Data-Tier Application Framework, Transact-SQL ScriptDom, and the System CLR Types.

But just like Naveed, that doesn't work, but we found a different solution instead of modifying Windows Registry.]]></description>
				<content:encoded><![CDATA[<p>My friend <a href="https://twitter.com/DanielGovier" target="_blank">Daniel Govier</a> was having the following error when installing Sitecore 9 Update 1 using XP0:</p>
<blockquote><p>[&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212; InstallWDP : WebDeploy &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-]<br />
[WebDeploy]:[Path] &lt;C:\Program Files\iis\Microsoft Web Deploy V3\msdeploy.exe&gt;<br />
<strong>msdeploy.exe : Error Code: ERROR_SCRIPTDOM_NEEDED_FOR_SQL_PROVIDER</strong><br />
At &lt;C:\Program Files\WindowsPowerShell\Modules\SitecoreInstallFramework\1.1.0\Public\Tasks\Invoke-CommandTask.ps1:31&gt; char:13<br />
+ &amp; $Path $Arguments | Out-Default<br />
+ ~~~~~~~~~~~~~~~~~~<br />
+ CategoryInfo : NotSpecified: (Error Code: ERR&#8230;OR_SQL_PROVIDER:String) [], RemoteException<br />
+ FullyQualifiedErrorId : NativeCommandError</p>
<p>More Information: The SQL provider cannot run because of a missing dependency. Please make sure that Microsoft SQL Server Transact-SQL ScriptDom is installed. Learn more at:<br />
http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_SCRIPTDOM_NEEDED_FOR_SQL_PROVIDER.</p></blockquote>
<p>Following the traditional path of any Sitecore developer, we googled that error and ended up in <a href="https://naveed-ahmad.com/2017/11/03/sitecore-9-sif-installation-error-error_scriptdom_needed_for_sql_provider/" target="_blank">this blog article</a> from <a href="https://twitter.com/naveed_ahmad" target="_blank">Naveed Ahmad</a>. Problem is that Daniel had already followed his article and installed SQL Server Data-Tier Application Framework, Transact-SQL ScriptDom, and the System CLR Types.</p>
<p>But just like Naveed, that doesn&#8217;t work, but we found a different solution instead of modifying Windows Registry.</p>
<p><strong>Do you guys think there are any issues with the following approach?</strong></p>
<h2>Register &#8216;Microsoft.SqlServer.TransactSql.ScriptDom.dll&#8217;</h2>
<p>More googling sent us to <a href="https://forums.iis.net/t/1235672.aspx?Web+Deploy+ERROR_SCRIPTDOM_NEEDED_FOR_SQL_PROVIDER" target="_blank">this article</a>. The valid answer is that we still need to register &#8216;<em>Microsoft.SqlServer.TransactSql.ScriptDom.dll</em>&#8216;. However, of course, the answer was pointing to local folders, so we need to:</p>
<ol>
<li>Find out where &#8216;gacutil.exe&#8217; is. It can be somewhere like &#8216;<em>C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6.2 Tools\</em>&#8216; as shown at the article, but it can be somewhere else. Use Windows Explorer to find it, and if you have multiple entries use the one that looks more recent.
<ol>
<li>Copy the whole path to it &#8211; we will need it in step 3</li>
</ol>
</li>
<li>Find your &#8216;<em>Microsoft.SqlServer.TransactSql.ScriptDom.dll</em>&#8216; &#8211; again look for the newest version
<ol>
<li>Copy the whole path again to use in step 3</li>
</ol>
</li>
<li>Open your command prompt and type:
<ol>
<li>cd &#8220;<em>Path_from_step_1</em>&#8221; (enter)</li>
<li>gacutil&#8221; /i &#8220;<em>Path_from_step_2</em>\Microsoft.SqlServer.TransactSql.ScriptDom.dll&#8221; (enter)</li>
</ol>
</li>
</ol>
<p>If everything goes right your library is now registered on GAC and you will be able to install Sitecore 9!</p>
]]></content:encoded>
			<wfw:commentRss>https://blog.peplau.com.br/still-have-error_scriptdom_needed_for_sql_provider-when-installing-sitecore-9/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
