Archive for the ‘Visual Studio’ Category

First of all, they’re not the same, so if you’ve already created Windows 8 app you will need to consider upgrading them.

On a windows 8.1 device, you will be able to use both the old windows 8 apps, as well as the new windows 8.1 apps. On a windows 8 device however, you will only be able to use windows 8 apps; in the app store, windows 8 users will only see windows 8 apps, so 8.1 apps will not even be visible. For windows 8.1 users, the 8.1 apps will appear in search results first, so it is recommended to upgrade your apps if you want to keep your ranking up.

Windows 8.1 apps can only be created and edited in Visual Studio 2013, and upon opening an older windows 8 app in Visual Studio 2013 you will be prompted to upgrade the solution. After following the instructions to upgrade the solution, your windows 8 project will be upgraded to 8.1.

Without even making any code changes, your app will instantly be faster than before in both the initial start-up and general app use.

Visual Studio 2013 can be used to edit and maintain older windows 8 apps, however to create new windows 8 compatible apps, you need to use Visual Studio 2012, which can run alongside Visual Studio 2013.

Some code has been deprecated with 8.1 apps, for example all the state-related code is now redundant as Windows 8.1 does away with the ‘snapped’ views in exchange for freely-sized apps from full screen right down to 500px or 320px. App developers will need to update any code that checks for the ‘snapped’ state, and replace it with direct checks to the apps ‘width’ property.

When opening an app in Visual Studio 2013, you will be prompted if your solution has any deprecated code so that you know what needs to be updated.

Apps will now optionally be able to set a minimum width of either 500px, or 320px (where 320px was the ‘snapped’ equivalent in windows 8).

When uploading your app to the Windows App Store, you will be able to upload both a Windows 8 version and a Windows 8.1 version within the same store submission, so that it will share the same Name and Publisher etc. You will however need to specify a unique Description, Features, and Screenshots for each, as you are likely to be changing some things or adding new features with the 8.1 updates.

One important thing to note when creating your 8.1 app side-by-side to your 8 app is that the 8.1 app version number CAN NEVER exceed the version number of the 8.1 app where you FIRST uploaded it. For this reason it’s a good idea to give the windows 8 app version number plenty of room for increments before the windows 8.1 app version number starts.

CodeLens gives us a quick overview of each of our methods, including what other methods reference this one, who modified the method last, and what changes they made, and also the unit tests we have that use the method.

CodeLens is available on every method, and is automatically added to new methods. CodeLens appears to take up a line in the code editor just above the method name, however it doesn’t actually consume a line in the document, so you won’t be able to accidently arrow up onto that line for example, and it won’t mess up line numbering.

  • References – Displays a count of methods that make a call to the selected method. Click on this to display the list of referring methods, and select one to navigate directly to the method.
  • Unit Tests – Displays a total of passed unit tests out of total unit tests for the selected method. If there are any failed unit tests, a red ‘x’ will appear beside it so you can easily identify that this method may be causing a unit test to fail. Click on this to see the list of unit tests for the method, and which one(s) failed if applicable. You can also click on one of the unit tests to navigate directly to the definition.
  • Last Modified By – Displays the name of the person who last touched this method. This requires TFS 2013 source control. Click on the name to view the change set they checked in when modifying this method, and when the changes were done.
  • Changes – Displays a count of the number of changes made to the current method by the last modified by. Clicking on this opens a comparison window which shows exactly what changes were made to the method.

There is also an option to send an email to the person who last modified the method, which automatically generates a hyperlink to a portable view comparing their changes, which does not require Visual Studio to open. This can be useful if you are reviewing code and need to ask someone about recent changes.

When writing new unit tests, your CodeLens’s will automatically update when you build your solution, so you will immediately be able to see if your unit tests have failed when viewing the CodeLens for a method.

Code Map allows you to map out the structure of your application by connecting your methods to see what methods link to each other, so you visually see how your application flows. This new feature is also great for easily understanding other people’s code by following the hierarchy without getting lost along the way.

To start a code map, right click any method and select the Code Map option. This will start a new map containing just the selected method. You can then right click the method node to find references of other methods that call the selected method. This will add a node for each of the referencing methods, and connect them on the code map.

You can also drill into related methods to add these to the code map, or even right click additional methods to add these to the code map, showing how they link to other existing methods in the code map.

At any point you can click on a node in the code map to instantly jump to that method. This provides a quick way of navigating between methods without forgetting where you are, or having to try and find where you came from again.

If you’re trying to debug code, or you’re going through someone else’s code, you will also have the ability to flag a node for follow-up, which highlights the node in red so you can easily find it in future. You can also add a note/comment to the node if you need to remind yourself to fix this method for example.

Once you’ve created your code map, you can optionally save a copy to your local drive. This will generate a file which anyone can open in Visual Studio 2013 allowing them to view the layout of the methods you’ve added.

Another new feature is the Code Map Debugger, which is similar to the code map, but allows you to map out the structure and hierarchy of methods while debugging. This means you can start from say the ‘Execute’ method, and as you step into different methods it will start to generate your code map automatically, and show all the different branches your application takes. Only methods that actually get called will be displayed, so depending on user selection or input the code map may not display all possible code paths, only those that have directly been called.

To start the code map, just click the ‘Code Map’ button on the toolbar while debugging.

Once you’ve finished debugging, your code maps are not wiped, so you can adjust your code and start debugging again to kick off again using the same code map.

Here’s some notes from the Visual Studio 2013 session this morning at Build 2013 describing some of the cool new features we can expect. Note that this is only from the VS2013 preview, so there may be some more features to come in the full version.

  • Ability to log in and sync settings and themes; similar to Office 2013, you will be able to log in with your Microsoft Account and choose settings to sync between all your devices running Visual Studio 2013.
  • All options menus and toolbars now have a built in search bar for quickly finding settings. The Quick launch bar in the top right corner introduced in VS2012 can also be used to quickly find settings and options.
  • The options menus can now be resized, so you’re not restricted to the default size.
  • Updates to visual studio will now appear as individual updates that you can choose to install or dismiss, rather than forcing you to install all or nothing. If you dismiss an update it will not remind you again. Informational updates will appear as white, while warning updates will be yellow, and critical updates will be red.
  • 200+ bugs with high DPI monitors have been fixed with VS2013, including how options are displayed
  • New enhanced scrollbar allows you to see a small preview of your code file, allowing you to easily locate break points and changes.
  • The ability to auto-complete braces, comments, and quotes has now also been included out of the box, meaning you can open a curly brace and start writing without worrying about the ending brace.
  • Instead of pressing F12 to navigate to a method, and losing your place in your previous file, you can now use Preview Peek, by pressing Alt + F12 instead of just F12, which allows you to view the method or class inline of the same document. From within that document you can then navigate into further documents, all within the same Preview Peek instance, using breadcrumbs to navigate backwards again. You can also simply press Esc to close the Preview Peek taking you back to the original document. At this time we cannot edit code within the Preview Peek pane, however this may be included in the full release.
  • Solutions will now be loaded async, meaning you can open solutions with 100+ projects, and they will open in the background allowing you to work on files while everything else loads. The files you last had open will load first allowing you to quickly resume where you left off.
  • Code Lens above each method allows you to show what references this method, and also who wrote the method, and who tested it. You can also see the unit tests the use the method, and easily run them.
  • Building projects or solutions will now also be performed async, so you can start a build and continue working while it processes in the background. You also now have the ability to cancel a build if you choose.

If you want to check out the Visual Studio 2013 preview for yourself, you can download it from Microsoft: