Page 1 of 1

System.InvalidCastException: Unable to cast object of type..

PostPosted: December 11th, 2017, 1:35 pm
by SteveG
I'm getting a dialog box every time I launch my VisualStudio 2017 referring (I think) to this error in my ActivityLog.xml:

System.InvalidCastException: Unable to cast object of type 'Devsense.PHP.Syntax.Ast.ConcatEx' to type 'Devsense.PHP.Syntax.Ast.CompoundVarUse'.
 at Devsense.PHP.Syntax.Ast.BasicNodesFactory.Call(Span span, LangElement nameExpr, CallSignature signature, TypeRef typeRef)
 at Devsense.PHP.Syntax.Parser.DoAction(Int32 action)
 at Devsense.PHP.Syntax.ShiftReduceParser`2.Reduce(Int32 rule_nr)
 at Devsense.PHP.Syntax.ShiftReduceParser`2.Parse()
 at Devsense.PHP.Syntax.Parser.Parse(ITokenProvider`2 lexer, INodesFactory`2 astFactory, LanguageFeatures language, IErrorSink`1 errors, Int32 positionShift)
 at 
	.Parse(INodesFactory`2 factory, IErrorSink`1 errors)
--- End of stack trace from previous location where exception was thrown ---
 at Microsoft.VisualStudio.Telemetry.WindowsErrorReporting.WatsonReport.GetClrWatsonExceptionInfo(Exception exceptionObject)


... I'm not sure what it relates to (syntax highlighting?) or how it effects my VisualStudio experience as I am able to continue past it and code; but I would like to know how to get rid of it and have my VisualStudio running at 100%.

Re: System.InvalidCastException: Unable to cast object of ty

PostPosted: December 11th, 2017, 3:38 pm
by Michal Brabec
Hi Steve,
the issue is caused by the PHP parser and it was fixed in the latest version of PHP Tools.
You can download it from our web https://www.devsense.com/download.
Let us know if you experience further problems and we will fix them in the upcoming update.
Michal

Re: System.InvalidCastException: Unable to cast object of ty

PostPosted: January 6th, 2018, 5:47 am
by SteveG
Hi Michael,

I sent you an email on December 12:

Hi Michael,

Thanks very kindly for replying to my post so quickly. I’d like to keep the discussion on the support board but need to send you an attachment which I don’t want public.

Attached is the log from the failed attempt to install the recent version that you recommended. Please advise,

Thanks in advance, and great product!

- Steve


... but as far as I can tell was not replied. I've also tried to install ver. 1.25.10502 which also breaks due to an installation problem. Can you advise me what to do or would you like me to email you my log file again?

Re: System.InvalidCastException: Unable to cast object of ty

PostPosted: January 11th, 2018, 5:52 pm
by SteveG
I'm also getting this in my output window:

The program '[13888] php_remote.exe' has exited with code -1 (0xffffffff).
Auto-attach to process '[15548] php_remote.exe' on machine 'SURFACE-PRO-3' succeeded.
The program '[15548] php_remote.exe' has exited with code -1 (0xffffffff).
Auto-attach to process '[2224] php_remote.exe' on machine 'SURFACE-PRO-3' succeeded.
Auto-attach to process '[1172] php_remote.exe' on machine 'SURFACE-PRO-3' succeeded.
The program '[2224] php_remote.exe' has exited with code -1 (0xffffffff).
The program '[1172] php_remote.exe' has exited with code -1 (0xffffffff).
Auto-attach to process '[5116] php_remote.exe' on machine 'SURFACE-PRO-3' succeeded.
The program '[5116] php_remote.exe' has exited with code -1 (0xffffffff).
Auto-attach to process '[1852] php_remote.exe' on machine 'SURFACE-PRO-3' succeeded.
The program '[1852] php_remote.exe' has exited with code -1 (0xffffffff).
Auto-attach to process '[4800] php_remote.exe' on machine 'SURFACE-PRO-3' succeeded.
The program '[4800] php_remote.exe' has exited with code -1 (0xffffffff).


... any suggestions (PLEASE!)

Re: System.InvalidCastException: Unable to cast object of ty

PostPosted: January 15th, 2018, 11:34 am
by Miloslav Beno
Hi Steve,

Thank you for providing us with the log installation log.

The original issue should be fixed in the latest version, but as I'm seeing from the log the installation failed, because:

Code: Select all
Install Error : Microsoft.VisualStudio.Setup.PackageFailureException: Package 'Microsoft.VisualStudio.AspNet45.Feature' failed to install


This is Microsoft component and it seems you are not only one with the same issue https://developercommunity.visualstudio.com/content/problem/31879/package-microsoftvisualstudioaspnet45featureversio-2.html

As Visual Studio team says: Looks like a Windows issue. Please try the solution (repair upgrade of Windows 10) https://answers.microsoft.com/en-us/windows/forum/windows_10-windows_install-winpc/how-to-perform-a-repair-upgrade-using-the-windows/35160fbe-9352-4e70-9887-f40096ec3085

About the output pane during debug, that seems like correct log during debug.

Hopefully what VS team suggest will work.

Thanks,

Re: System.InvalidCastException: Unable to cast object of ty

PostPosted: March 8th, 2018, 3:45 pm
by SteveG
A full-blown windows 10 pro crash has led me to reinstall and reconfigure all applications and files and I'm now running without this error. By the way, my windows was also not upgrading and nothing would appear in my Turn Windows features on or off.

Re: System.InvalidCastException: Unable to cast object of ty

PostPosted: March 12th, 2018, 1:59 pm
by Miloslav Beno
Thanks for letting us know, As suspected this was Windows issue. I'm glad you solved this one.