VS 2017 RC Crashing when opening PHP projects

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

VS 2017 RC Crashing when opening PHP projects

Postby jazz » December 18th, 2016, 10:48 pm

I'm not 100% sure this is the PHP tools extension, only about 80%. But when I try to open a second PHP project, whether it's in an entirely separate instance of VS, or even as a second project in my main solution, VS 2017 will fatally crash.

I kinda need this to work as I have quite a few composer libraries that I work on while I'm working on my main project. So normally when I'm working on my main project and I need to make changes to a library, I spin up a new VS instance and open the library project directly. This works fine in VS 2015.

Now here's the rub. If I go into the library directory and just delete "composer.json" before I open the project, the project will open fine. Obviously I can't do this as a permanent fix, but it's got me out of trouble for now.

Would someone be able to debug this issue and fix if it is indeed the PHP tools extension? Many Thanks.
Try Hazaar MVC - http://www.hazaarmvc.com
The MVC Framework that makes PHP not suck!

Image
User avatar
jazz
 
Posts: 41
Joined: August 25th, 2016, 1:59 am
Location: Canberra, Australia

Re: VS 2017 RC Crashing when opening PHP projects

Postby Miloslav Beno » December 19th, 2016, 12:31 pm

Hello,

Thanks for letting us know about the issue. Could you please send us activity log, hopefully there will be log of the exception that's happening. https://docs.devsense.com/troubleshooting/activitylog-xml

Thanks!
Miloslav Beno │ DEVSENSE s.r.o. │ @miloslavbenomiloslav@devsense.com
User avatar
Miloslav Beno
 
Posts: 1252
Joined: January 7th, 2012, 8:36 pm

Re: VS 2017 RC Crashing when opening PHP projects

Postby jazz » December 27th, 2016, 12:05 pm

So I finally got around getting a log. The process is a little different in VS2017, but I managed to figure it out quite easily.

I have attached the log file. To re-create the issue I did the following:

* Started VS2017 with logging enabled.
* Opened my main project.
* Right-clicked the solution in solution explore to add a new item
* Added an existing project

This is where it crashes. The project I tried to add is my main composer library (MVC framework) but it appears any project with a composer.json file will cause the crash. If I delete the composer.json file from the library I can restart VS2017 without it crashing.

Thanks.
You do not have the required permissions to view the files attached to this post.
Try Hazaar MVC - http://www.hazaarmvc.com
The MVC Framework that makes PHP not suck!

Image
User avatar
jazz
 
Posts: 41
Joined: August 25th, 2016, 1:59 am
Location: Canberra, Australia

Re: VS 2017 RC Crashing when opening PHP projects

Postby Miloslav Beno » December 29th, 2016, 2:28 pm

Hello,

Thanks for the activity log, unfortunately I don't see any related error or exception. Did you crash the VS once started with /log parameter ?

Of could you please send me the composer.json which cause it to crash I could try to replicate this.

Thanks,
Miloslav Beno │ DEVSENSE s.r.o. │ @miloslavbenomiloslav@devsense.com
User avatar
Miloslav Beno
 
Posts: 1252
Joined: January 7th, 2012, 8:36 pm

Re: VS 2017 RC Crashing when opening PHP projects

Postby jazz » January 4th, 2017, 12:54 am

Ok, this morning I have just completed LOTS of testing to try and figure this out. You dropped a big hint by asking for the composer.json file that has caused the crash.

So because of that, I think I have figured it out. :)

It is because of the "require" directives in the composer.json file. Now, this is just an assumption, but when the composer.json file is loaded the package requirements are going to be checked. And because it's a library project I'm trying to load these requirements are not going to be met and in fact, the "vendor" folder isn't even going to exist.

And there it is. If the extension is expecting this folder to exist and it's not there, then CRASH!!

I have confirmed that this is what is happening by doing the following:

* Open Visual Studio 2017 RC
* Create a new PHP web project.
* Add a composer package. ANY package is fine. I used hazaarlabs/hazaar-mvc which is my framework.
* Save everything and Exit VS (closing the solution does not always trigger this for some reason.... cache?).
* In explorer, navigate to the project folder and delete the "vendor" folder.
* Open the project you just created in VS2017.
* It will crash.

Here is a link to a quick video I did showing exactly what I did to make it crash. https://youtu.be/f2uMTJ-wJK4

Hope that helps.

Jamie
Try Hazaar MVC - http://www.hazaarmvc.com
The MVC Framework that makes PHP not suck!

Image
User avatar
jazz
 
Posts: 41
Joined: August 25th, 2016, 1:59 am
Location: Canberra, Australia

Re: VS 2017 RC Crashing when opening PHP projects

Postby Miloslav Beno » January 4th, 2017, 2:19 pm

Hi Jamie,

Thank you for putting so much effort to this! Thanks to your detailed description and video it was very easy to fix it! We should have preview version with the update very soon, so you can try it out.

Just note... this happens only in VS2017 RC, all the other VS versions are fine.

Thanks and have a great day,
Miloslav Beno │ DEVSENSE s.r.o. │ @miloslavbenomiloslav@devsense.com
User avatar
Miloslav Beno
 
Posts: 1252
Joined: January 7th, 2012, 8:36 pm

Re: VS 2017 RC Crashing when opening PHP projects

Postby Miloslav Beno » January 4th, 2017, 3:27 pm

Please check the preview https://www.devsense.com/download

Thank you!
Miloslav Beno │ DEVSENSE s.r.o. │ @miloslavbenomiloslav@devsense.com
User avatar
Miloslav Beno
 
Posts: 1252
Joined: January 7th, 2012, 8:36 pm

Re: VS 2017 RC Crashing when opening PHP projects

Postby jazz » January 5th, 2017, 7:55 am

Hi Miloslav,

It now looks to be working for the removing problem with a missing "vendor" folder! Thanks!

However, VS2017 still crashes when I try to add the library project to the open solution. :( I guess I was wrong and they are not actually the same problem. For now though I can at least open the library to edit it in a second instance of VS while I'm debugging my main app. That will keep me out of trouble.

Also, nothing major, but I think the build versions are off. Downloading 9415 and trying to install it, it says it was already installed. So I removed the existing extension and re-installed without a problem. The version in "Help/PHP Tools..." still says 9350, however the symptoms of my problem have changed.

Thanks again.

Jamie
Try Hazaar MVC - http://www.hazaarmvc.com
The MVC Framework that makes PHP not suck!

Image
User avatar
jazz
 
Posts: 41
Joined: August 25th, 2016, 1:59 am
Location: Canberra, Australia

Re: VS 2017 RC Crashing when opening PHP projects

Postby jazz » January 6th, 2017, 12:12 am

Damn. Forget that. Just tried this again this morning (without any changes) and it's crashing again (still?).

Possibly a build issue because after installing the 9415 file it still says the version is 9350?
Try Hazaar MVC - http://www.hazaarmvc.com
The MVC Framework that makes PHP not suck!

Image
User avatar
jazz
 
Posts: 41
Joined: August 25th, 2016, 1:59 am
Location: Canberra, Australia

Re: VS 2017 RC Crashing when opening PHP projects

Postby Miloslav Beno » January 11th, 2017, 3:22 pm

Hi Jazz,

You were correct, 9350 had build issue in version for VS2017RC. Now it should be fixed in the latest preview https://www.devsense.com/download.

If you could give it a try to see if it's fixed for you now, it would be great!

Thanks!
Miloslav Beno │ DEVSENSE s.r.o. │ @miloslavbenomiloslav@devsense.com
User avatar
Miloslav Beno
 
Posts: 1252
Joined: January 7th, 2012, 8:36 pm

Next

Return to PHP Tools

Who is online

Users browsing this forum: No registered users and 87 guests

cron

User Control Panel

Login

Who is online

In total there are 87 users online :: 0 registered, 0 hidden and 87 guests (based on users active over the past 5 minutes)
Most users ever online was 330 on April 19th, 2024, 1:35 am

Users browsing this forum: No registered users and 87 guests