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

PHP Tools [?] extends Visual Studio with set of advanced features to work more efficiently with PHP code.

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

Postby SteveG » December 11th, 2017, 1:35 pm

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%.
SteveG
 
Posts: 9
Joined: December 11th, 2017, 1:31 pm

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

Postby Michal Brabec » December 11th, 2017, 3:38 pm

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
Michal Brabec │ DEVSENSE s.r.o. │ @gMichalBrabecmichal.brabec@devsense.com
User avatar
Michal Brabec
 
Posts: 13
Joined: September 14th, 2016, 8:55 am

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

Postby SteveG » January 6th, 2018, 5:47 am

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?
SteveG
 
Posts: 9
Joined: December 11th, 2017, 1:31 pm

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

Postby SteveG » January 11th, 2018, 5:52 pm

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!)
SteveG
 
Posts: 9
Joined: December 11th, 2017, 1:31 pm

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

Postby Miloslav Beno » January 15th, 2018, 11:34 am

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,
Miloslav Beno │ DEVSENSE s.r.o. │ @miloslavbenomiloslav@devsense.com
User avatar
Miloslav Beno
 
Posts: 1252
Joined: January 7th, 2012, 8:36 pm

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

Postby SteveG » March 8th, 2018, 3:45 pm

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.
SteveG
 
Posts: 9
Joined: December 11th, 2017, 1:31 pm

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

Postby Miloslav Beno » March 12th, 2018, 1:59 pm

Thanks for letting us know, As suspected this was Windows issue. I'm glad you solved this one.
Miloslav Beno │ DEVSENSE s.r.o. │ @miloslavbenomiloslav@devsense.com
User avatar
Miloslav Beno
 
Posts: 1252
Joined: January 7th, 2012, 8:36 pm


Return to PHP Tools

Who is online

Users browsing this forum: No registered users and 57 guests

cron

User Control Panel

Login

Who is online

In total there are 57 users online :: 0 registered, 0 hidden and 57 guests (based on users active over the past 5 minutes)
Most users ever online was 256 on March 28th, 2024, 9:42 am

Users browsing this forum: No registered users and 57 guests