Running Visual Studio as an administrator causes ‘Save changes to devenv.sln’ when double clicking solutions

After making sure my Visual Studio always ran as an administrator by following my own post HowTo: Have Visual Studio always run as administrator on Windows 8, I got a message if I wanted to save changes to devenv.sln each and every time I double clicked a Solution. Since the problem kept occuring after installing Visual Studio 2015 CTP6, I wanted to solve it. So here we go!

Double clicking a Solution file doesn’t start devenv.exe (which is set to be run as an administrator) but will cause the Microsoft Visual Studio Version Selector (VSLauncher.exe) to be run. This tool selects the right version of Visual Studio to open the Solution. Because VSLauncher.exe is not being run as an administrator, the error occurs.

The Solution

Find VSLauncher.exe, which is typically located at ‘C:\Program Files (x86)\Common Files\Microsoft Shared\MSEnv’ and make sure it runs as an administrator too. This will cause the Version Selector to be started with the correct privileges, helping it start devenv.exe with the right privileges. Problem solved ;)

Hope this helps

Fixing the Remote Desktop Connection to a Virtual Machine in Microsoft Azure

A few minutes before my second session at the Dutch Techdays started I tried connecting to my Virtual Machine in Microsoft Azure through remote desktop. It didn’t connect… The RDP client tried to connect to the Virtual Machine, but nothing happened.

So I rebooted the VM and tried connecting again, confident that this would solve the problem. It didn’t connect…. again. As I started stressing out a bit (the VM was the main character of my session) I thought of one last thing I could try.

Fixing the issue

The next steps helped me save my Virtual Machine without too much loss of time (I was able to connect again just before the start of my session!):

  • Go to the Azure Management Portal
  • Open up the details of the VM you’re having trouble with
  • Go to the ENDPOINTS tab (see image below)
  • Select the ‘Remote Desktop’ endpoint and click EDIT at the bottom of the screen
  • Change the public port to a different (random) number
  • Wait for the changes to be propagated
  • Success!

Azure Management Portal

Hope this helps.

Getting Bootstrap to work on Windows Phone 8

There are a couple of websites I manage that use Twitter Bootstrap*. These websites are fully responsive and work well on all devices. Or actually, almost all devices. The wrapping of columns in a container on a Windows Phone doesn’t work the way you’d want it out of the box. Windows Phone interprets device-width as the actual resolution size. Other mobile browsers use what the manufacturer (or browser vendor) has decided is the optimal viewport width.

To fix this issue, follow these steps:

  1. Add this line to use –ms-viewport in your CSS file
    @-ms-viewport{
        width: device-width;
    }
  2. Add this line to the head tag of your HTML page (it’s probably already there since you’re using Bootstrap)
    <meta name="viewport" content="width=device-width, initial-scale=1" />
  3. Add this JavaScript function as the first script in the head tag (because of a timing issue it won’t work if it isn’t the first script)
    (function() {
        if ("-ms-user-select" in document.documentElement.style && 
            navigator.userAgent.match(/IEMobile\/10\.0/)) {
            var msViewportStyle = document.createElement("style");
            msViewportStyle.appendChild(
                document.createTextNode("@-ms-viewport{width:auto!important}")
            );
            document.getElementsByTagName("head")[0].appendChild(msViewportStyle);
        }
    })();

I found this solution over at Matt Stow’s blog ‘Firewoiks’. You can find the original article here.

Hope this helps.

* The Bootstrap project is no longer under the Twitter brand.

Originally created by a designer and a developer at Twitter, Bootstrap has become one of the most popular front-end frameworks and open source projects in the world. – about Bootstrap

Speaking at TechDays 2014

Techdays14_Logo_1I’m proud to announce that this year I’ll be speaking at the TechDays in the World Forum in Den Haag, April 16 – 17. This session will be about High Performance Computing in Windows Azure.

Camera resolutions keep increasing, your digital behavior on websites and in apps is collected, images that satellites make get more and more detailed and (research) equipment produces more data. The amount of data that’s being stored keeps increasing. This data often has to be processed to become information. With increasing amounts of data to be processed the need for a Cluster like solution to achieve this within acceptable time grows. With the rise of the Cloud you don’t need to have that Cluster in the basement anymore, but you can leverage the power and capacity of the Cloud. In this session you see how High Performance Computing in Windows Azure can be used to distribute processing tasks to multiple machines in Windows Azure.

HowTo: sign out of Visual Studio Online (when deleting cookies won’t help)

When you have more than one Microsoft Account that you use regularly, you might recognize the scenario where your Visual Studio keeps you signed in to Visual Studio Online… with the wrong account. You keep getting messages that you don’t have access rights. Restarting Visual Studio, rebooting and even clearing all (Visual Studio) cookies doesn’t help. Here’s a quick fix:

  1. Open Visual Studio
  2. Open the Visual Studio web browser (under View, Other Windows, Web Browser)
  3. Go to Visual Studio Online
  4. Click sign out

You should be good to go now!

Hope this helps.

Enable preview in Visual Studio 2012 after Update 1

tabsandwindows

After installing Visual Studio 2012 Update 1, my Visual Studio stopped opening files in preview mode when I clicked them in the Solution Explorer. This setting seems to have changed with the installation of Update 1. To re-enable opening files clicked (once) in the Solution Explorer in Preview mode, go to ‘Tools’ – ‘Options’ – ‘Environment’ – ‘Tabs and Windows’.

There, check the box under ‘Preview Tab’ – ‘Single-click opens files in the preview tab in:’ – ‘Solution Explorer (Alt + click to avoid previewing)’.

Hope this helps

EDIT:
This is a lot easier: the ‘Preview Selected Items’ button in the Solution Explorer toolbar:

Preview Selected Items button

By |December 2nd, 2012|HowTo, Tip, VS2012|0 Comments

TIP: “Paste XML as Classes” in Visual Studio 2012

pastespecial

In the past, when you had some XML document that you wanted to translate into classes we had to create / generate a schema based on the XML file. Next, we had to generate a class based on the schema with an external tool. Not all too user friendly and somewhat time consuming.

In Visual Studio 2012 you copy the XML you want to create a class/classes for, place the cursor in a class file on the location you want the code to be added and select the following menu items: Edit – Paste Special – Paste XML as Classes. And you’re done! Just like that…

If you want to try real quick, there’s a sample XML file (books.xml) available here.

EDIT
The feature is .NET Framework 4.5 specific. Taken from this MSDN article ‘Generating Data Type Classes from XML‘:
“.NET Framework 4.5 includes a new feature to generate data type classes from XML.

The Visual Studio 2010 Test Client for WCF services

When writing WCF services, most of us find ourselves writing quick test applications. To give you more time to do what a developer should be doing (adding business value to the project) the Visual Studio team added a WCF test client that can help you reach goals faster.

This is not a very difficult application, but it does the trick and is more than sufficient for simple testing. The WCF Test Client can be found at this location (without the ‘ (x86)’ for x86 machines): C:Program Files (x86)Microsoft Visual Studio 10.0Common7IDE.

Taken from the help:

Windows Communication Foundation (WCF) Test Client (WcfTestClient.exe) is a GUI tool that allows users to input test parameters, submit that input to the service, and view the response that the service sends back. It provides a seamless service testing experience when combined with WCF Service Host.

WCF Test Client screenshots:
image image

Updated: Thanks to Marco for pointing out my typo…!

HowTo: open all files from the Find Results window

Here’s a quick Visual Studio tip for you…

I frequently search for a specific text in my solution because I need to do something in all places where that text occurs. Today I found out how you can open all the files that are mentioned in the Find Results window.

Search for the text you’re looking for. In my case this is ITest*.
Open up the Search Results window and select all the records where the text was found. You can do this by dragging your mouse cursor over the text or clicking the text of the first search result, holding SHIFT and clicking the text of the last.
Search Results for ITest

Right click anywhere on the selected text and choose ‘Go to location’. If you click anywhere other than on selected text, you will lose the selection and you’ll probably get just one file opened. When all files are opened you will keep the ‘Go To Next Location F8’ and ‘Go To Previous Location SHIFT + F8’ functionality. That might be a nice one to loop through all the locations where your text was found. Especially when it was found more than once in one file.

Hope this helps.

 

* The usefulness of searching for this interface is arbitrary due to functionality as ‘Find all references’ and so on. Luckily I’m only using it for this example. So lets not focus on that but on the tip this post is about ;)