Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ArgumentNullException: Value cannot be null #508

Closed
reedyd opened this issue Oct 7, 2015 · 14 comments
Closed

ArgumentNullException: Value cannot be null #508

reedyd opened this issue Oct 7, 2015 · 14 comments

Comments

@reedyd
Copy link

reedyd commented Oct 7, 2015

Context: Windows 7, Sitecore.NET 7.2 (rev. 141226), SPE 3.0

SPE works on our Win 2008 R2 servers, but I'm having trouble locally on Win 7. Installation and reinstallation of SPE is clean, and PS console works, but, as soon as I try to open PS ISE, I get this:

[ArgumentNullException: Value cannot be null.
Parameter name: key]
System.Collections.Generic.Dictionary2.FindEntry(TKey key) +14312893 System.Collections.Generic.Dictionary2.TryGetValue(TKey key, TValue& value) +20
Microsoft.VisualStudio.Web.PageInspector.Runtime.WebForms.SelectionMappingRenderTraceListener.GetLiteralTraceData(LiteralControl literal, TraceData& data) +71
Microsoft.VisualStudio.Web.PageInspector.Runtime.WebForms.SelectionMappingRenderTraceListener.GetTraceData(Object renderedObject) +223
Microsoft.VisualStudio.Web.PageInspector.Runtime.WebForms.SelectionMappingRenderTraceListener.EndRendering(TextWriter writer, Object renderedObject) +47
System.Web.UI.RenderTraceListenerList.EndRendering(TextWriter writer, Object renderedObject) +90
System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +12389839
System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +246
Sitecore.Web.UI.XmlControls.GenericControl.DoRender(HtmlTextWriter output) +357
Sitecore.Web.UI.WebControl.Render(HtmlTextWriter output) +376
System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +150
Sitecore.Web.UI.Sheer.ClientPage.OptimizeControlTree(Control control) +177
Sitecore.Web.UI.Sheer.ClientPage.OptimizeControlTree(Control control) +357
Sitecore.Web.UI.Sheer.ClientPage.OptimizeControlTree(Control control) +357
Sitecore.Web.UI.Sheer.ClientPage.OptimizeControlTree(Control control) +357
Sitecore.Web.UI.Sheer.ClientPage.OptimizeControlTree(Control control) +357
Sitecore.Web.UI.Sheer.ClientPage.OptimizeControlTree(Control control) +357
Sitecore.Web.UI.Sheer.ClientPage.OptimizeControlTree(Control control) +357
Sitecore.Web.UI.Sheer.ClientPage.OptimizeControlTree(Control control) +357
Sitecore.Web.UI.Sheer.ClientPage.OptimizeControlTree(Control control) +357
Sitecore.Web.UI.Sheer.ClientPage.OptimizeControlTree(Control control) +357
Sitecore.Web.UI.Sheer.ClientPage.OptimizeControlTree(Control control) +357
Sitecore.Web.UI.Sheer.ClientPage.OptimizeControlTree(Control control) +357
Sitecore.Web.UI.Sheer.ClientPage.OptimizeControlTree(Control control) +357
Sitecore.Web.UI.Sheer.ClientPage.SaveViewState() +27
System.Web.UI.Control.SaveViewStateRecursive(ViewStateMode inheritedMode) +446
System.Web.UI.Page.SaveAllState() +723
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +4860

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.34249

I also see this error in the server log, but it's during server startup, so I'm not sure if it's related:

32688 16:25:14 ERROR Failed to load XML control: <>\src\cms\website\sitecore modules\PowerShell\Assets\Cognifide.PowerShell.dll-Help.xml
Exception: System.Xml.XmlException
Message: There is no Unicode byte order mark. Cannot switch to Unicode.
Source: System.Xml
at System.Xml.XmlTextReaderImpl.Throw(Exception e)
at System.Xml.XmlTextReaderImpl.CheckEncoding(String newEncodingName)
at System.Xml.XmlTextReaderImpl.ParseXmlDeclaration(Boolean isTextDecl)
at System.Xml.XmlTextReaderImpl.Read()
at System.Xml.XmlReader.MoveToContent()
at Sitecore.Web.UI.XmlControls.FolderControlSource.IsXmlControl(String controlFile)

I'm also seeing a few of these in the log:

ManagedPoolThread #7 16:27:59 ERROR Cannot find dictionary domain for the dictionaty entry '/sitecore/system/Modules/PowerShell/Fonts/Consolas'('{1910AC65-194F-4629-A353-191976AC8F53}').

@michaellwest michaellwest self-assigned this Oct 8, 2015
@michaellwest
Copy link
Member

I suspect that it's tied to a bug we discovered in a previous version of SPE; perhaps when the home item does not exist. You indicated that it was v3.0. Can you install v3.3?

@AdamNaj
Copy link
Member

AdamNaj commented Oct 8, 2015

Given it works for you on production server I wonder if (before we go ahead with further investigation) you could verify which version of Windows PowerShell you have? You can check it using the Get-Host cmdlent and the result should look somewhat similar to the following image:

image

If your indicated version of Windows PowerShell is 2.0 - it might be the cause of the problem. I would suggest that you update to at least version 3 or even better 4.

@reedyd
Copy link
Author

reedyd commented Oct 8, 2015

Windows PS was on v2.0. I upgraded to v3.0, and it works great now. Thank you!

@reedyd reedyd closed this as completed Oct 8, 2015
@AdamNaj
Copy link
Member

AdamNaj commented Oct 8, 2015

Great! Enjoy! :)

@AdamNaj
Copy link
Member

AdamNaj commented Oct 9, 2015

From what I see in the error it seems Sitecore attempts to open the PowerShell MAML - help file as it was a Sheer control and that problem was rectified in version 3.1 in issue #317 - while the error reported in that issue was manifesting itself in the logs only - yours seems to be showing much more violently - looking at your stack trace I suspect it might be due to Visual Studio inserting itself in the mix.

If that indeed is the case - you should be able to alleviate the error by deleting the \src\cms\website\sitecore modules\PowerShell\Assets\Cognifide.PowerShell.dll-Help.xml file as starting from 3.1 (Issue #317) it no longer is named like this and this file is just a debris.

@reedyd
Copy link
Author

reedyd commented Oct 9, 2015

I removed Cognifide.PowerShell.dll-Help.xml, and the "Failed to load XML control" error no longer appears in the log. However, the "ArgumentNullException: Value cannot be null" problem remained. I also reinstalled PSE 3.3, and the problem remained.
Should it help to manually uninstall all PSE file artifacts?

@AdamNaj
Copy link
Member

AdamNaj commented Oct 10, 2015

I wonder about one additional thing. Did you have at any point SPE 2.x installed on those environments? If that is the case - did you perform the actions outlined in this blog post?

@AdamNaj
Copy link
Member

AdamNaj commented Oct 10, 2015

Since I didn't see anything SPE related in your stack trace as well I've gone online to seek if I could see anything from your stack trace and found this blog post. I wonder if this is not the cause of your problem? Also this.

@reedyd
Copy link
Author

reedyd commented Oct 12, 2015

Thanks Adam, I will look into those ideas...

@reedyd
Copy link
Author

reedyd commented Oct 12, 2015

I don't think I had installed SPE v2.n, but in any case, I walked through that article, and confirmed that none of those folders existed.

Disabling Page Inspector resolved the "ArgumentNullException: Value cannot be null" error. SPE now opens up cleanly. However, it just churns and churns, even on the simplest of commands (i.e. get-host)... it never completes execution. No errors displayed, or recorded in the log:|

It's interesting to note that the log shows this activity when I issue "get-host" command from console:
ManagedPoolThread #15 11:31:22 INFO Job started: PowerShell-f0587cf5-f165-79c6-b97d-0336583c52aa-{A5F68D81-4D11-4B83-B988-B38291952360}
ManagedPoolThread #15 11:31:22 INFO Executing a Sitecore PowerShell Extensions script.
ManagedPoolThread #15 11:31:22 INFO Job ended: PowerShell-f0587cf5-f165-79c6-b97d-0336583c52aa-{A5F68D81-4D11-4B83-B988-B38291952360} (units processed: )

...and it shows this activity when I issue "get-host" command from SPE:
5796 11:31:52 INFO Executing a Sitecore PowerShell Extensions script.
5796 11:31:52 INFO Executing a Sitecore PowerShell Extensions script.
ManagedPoolThread #9 11:31:52 INFO Job started: ScriptExecution
ManagedPoolThread #9 11:31:52 INFO Executing a Sitecore PowerShell Extensions script.
ManagedPoolThread #9 11:31:54 INFO Job ended: ScriptExecution (units processed: )

...but only the console replies with the expected result. SPE does not reply.

@AdamNaj
Copy link
Member

AdamNaj commented Oct 12, 2015

OK. So it seems like we've solved the main problem with the environment.

Regarding the churning - there have been some changes in the way ISE retrieves results from 3.2 to 3.3 - I wonder if cleaning your browser cache just in case something got cached improves anything?

As to the differences in the log - that is very much an intended behaviour. Console talks to the server using WebService over AJAX, whereas ISE urilizes a different method and Sheer infrastructure.

@reedyd
Copy link
Author

reedyd commented Oct 12, 2015

I'm up and running now. I cleared all temp files from browser, OS, and restarted. Perhaps that was overkill, but I'm happy to have it fixed!

Thank you very much!!!

@reedyd reedyd closed this as completed Oct 12, 2015
@AdamNaj
Copy link
Member

AdamNaj commented Oct 13, 2015

Glad to hear that!

@RollForReflex
Copy link

Quick note on something mentioned in the original post - I'm still getting these errors talking about domain dictionary mismatches. I'm on version 3.3 (only version installed on the machine) and using PS 4.0 but can't figure out why the fonts are not part of a particular dictionary domain.

ERROR Cannot find dictionary domain for the dictionaty entry '/sitecore/system/Modules/PowerShell/Fonts/monospace'('{A1861BC6-98EF-4949-9E45-2A482B35B577}').

Thoughts?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants