Showing posts with label Visual Studio 2015. Show all posts
Showing posts with label Visual Studio 2015. Show all posts

09 July 2015

Gotcha: Azure website debugging not working in mixed VS2015RC solutions

As I was working on yet another piece of POC code showing off the power of both the Windows 10 IoT Core stuff and Microsoft Azure I ran into a very odd problem. My solution contains a plethora of project types: a Universal Windows Platform app targeted towards a Raspberry PI2, a Windows Phone app, some class libraries (some portable, some not) and – the lead actor of this post - an Azure website hosting a Signal/R hub.

I published my website to Azure with a few clicks (this stuff has become so easy it’s almost laughable, to the point that it’s more work to spin up a site on your local machine) and noticed the hub was nicely transmitting messages. Then I wanted to debug the hub (that is, the website). This is an awesome facility on Visual Studio and Azure these days – if you have published a debug build, you can simply attach a debugger to a running site, place breakpoints, see Debug.WriteLine statements writing on the output window… cue “It’s a kind of Magic” ;).

So I did set the Signal/R site to be my startup/project, opened the server explorer, expanded the Azure node, found my website and clicked “Attach Debugger”

image

The Edge browser, being the default browser on my Windows 10 system appeared, showing the default Azure website page indicating the website had been successfully created and then…. nothing. The debugger appeared to halt, but no breakpoints were hit, and the debugger then just stopped completely.

I tried a lot, but nothing helped. The annoying thing is, the solution was staring me in the face all the time but I was a bit tired. Look top right my friends, just right from the Solution Platforms dropdown, that now says “Any CPU”. There is another drop down and it says…. “Launch Windows App”.

image

You have to set this drop down to either “Internet Explorer” or “Google Chrome”  (I don’t know if more browsers appear in this drop down once they are installed) and then and only then the debugger works. You can see this by the selected browser appearing in stead of Edge.

If this is a bug (this is a RC after all) or just something I missed, I don’t know, but this is how you get it to work. I won’t tell you how much time it took me to find it out – I’d rather not remember it ;)

05 May 2015

Fixing Windows 10 emulators not showing up in VS2015RC or not having internet access

On one of my two PCs running Windows 10 10074 the Phone emulators did not have internet access, which is a bit of a hindrance if you want to write a demo that requires internet access, and after upgrading to VS2015RC from CTP6 I had an even bigger problem: the emulators did not even show up anymore. The only thing I saw was “Start”

image

I had inadvertently installed the Android Emulator, and there are apparently some issues with that. No amount of removing selected parts, repairing of modifying could fix it. So I went for the drastic solution: I uninstalled everything that remotely looked like it had something to do with VS2015RC, including the duplicate entry of the Windows Phone 8.1 emulators.

Then I opened the Hyper-V manager, removed all virtual machines there of Windows Phone 8.1 and 10 devicesimageAnd I deleted also all virtual switches. Now at one point the Hyper-V manager did not allow me to delete a virtual switch so I went for the bigger kill and removed all of Hyper-V by going into Programs and Features and uninstalling Hyper-V itself, and all the comes with it.

image
This requires the PC to reboot. After the reboot, I re-enabled Hyper-V again (which requires another reboot) and then I installed Visual Studio 2015RC again, sans the Android emulator and the cross-platform development kit, and then at last my Windows 10 emulators showed up – and they also now have internet access, albeit it takes them a minute to get it.

Your mileage may very, but this worked for me.