Sergiy Baydachnyy

Blog about technologies

Archive for the ‘Visual Studio’ Category

How to manage AllJoyn devices in C#: LIFX Color 1000 Example

with one comment

In the previous video we discussed, how to onboard an AllJoyn device using Visual Studio, C# and Windows 10 AllJoyn features (How to onboard AllJoyn devices in C#: LIFX Color 1000 Example).

Today, I am going to show, how we can start working with an “onboarded” AllJoyn device.

https://channel9.msdn.com/Series/Internet-of-Things-micro-boards-for-beginners/How-to-work-with-AllJoyn-devices-in-C-LIFX-Color-1000-example/player

Written by Sergiy Baydachnyy

06/06/2016 at 7:06 PM

Posted in IoT, Visual Studio, Windows 10

Tagged with

About Extensions in Visual Studio Code

leave a comment »

Written by Sergiy Baydachnyy

06/03/2016 at 8:08 PM

Posted in Visual Studio

Tagged with

ASP.NET Core and VS Code

leave a comment »

.NET Core RC 2, ASP.NET Core RC 2 and even .NET Core SDK are available for download. I have tested if it work with Visual Studio Code and… It works great!!!

You should not use any dnx/think about available runtimes and select between mono and coreclr/understand what is dotnet package manager and so on. You can simply install .NET Core and start creating your ASP.NET applications.

My updated video about VS Code and ASP.NET is here:

 

https://channel9.msdn.com/Series/Visual-Studio-Code-for-Mac-Developers/16-Start-working-with-ASPNET/player

And couple new videos in the series (about Express and Cordova tools):

https://channel9.msdn.com/Series/Visual-Studio-Code-for-Mac-Developers/17-Express/player

https://channel9.msdn.com/Series/Visual-Studio-Code-for-Mac-Developers/18-Tools-for-Apache-Cordova/player

Written by Sergiy Baydachnyy

06/01/2016 at 10:43 PM

Posted in Visual Studio

Tagged with

Visual Studio Code for Mac Developers 1.0

leave a comment »

Finally, I updated all modules in my training using Visual Studio Code 1.0. Additionally, I published 6 more modules and 7 more are coming. Here is the full list of all available videos (Express, Intro to Extensions, Office Extensions, TACO, PowerShell, Google chrome Extensions and Python are coming next week):

1. How to Install

2. Editor Features

3. Code Snippets

4. Git

5. Integration with VSTS

6. Integration with GitHub

7. Integration with Unity3D

8. A better way to integrate Code and Unity3D

9. Tasks

10. Debugging

11. How to deploy your site to Microsoft Azure

12. JavaScript

13. From JavaScript to TypeScript

14. Start working with NodeJS

15. Yeoman

16. Start working with ASP.NET

Written by Sergiy Baydachnyy

05/02/2016 at 10:01 PM

Posted in Visual Studio

Tagged with

UWP: Profiling and debugging tools in Visual Studio 2015

leave a comment »

I have already published a post about Live Visual Tree but Visual Studio 2015 has lots of different tools which allow you to tune your application on Universal Windows Platform. Let’s make an overview of some of these tools.

But before the start, just make sure that you switch the Enable Diagnostic Tools while debugging and PerfTip while debugging in the Debugging options. These tools should be enabled by default but it’s better to know how to disable/enable them:

clip_image001

Ok. Let’s talk about particular features, and I would like to start with the performance tips. Thanks to this feature you can use the breakpoints and debug mode to know exactly how much time has elapsed since the last breakpoint:

clip_image003

If you want to see this information for each line in your code you simply need to use debugger to go step by step through the code. But if you need to understand elapsed time for any of the blocks then you just need to set two breakpoints at the beginning and at the end of the block. So, using the performance tips you can easily locate problems with performance.

You can see that Visual Studio displays this information as tips and you can easily click these tips to navigate to Diagnostic Tools window, which is the second important tool which you can use together with performance tips:

clip_image005

Diagnostic Tools contains three sections. The first one shows events like information about exceptions, even if exception is caught; messages from output window which are generated by the Debug class; IntelliTrace events related to threads, assemblies etc. The next two sections show CPU utilization and usage of memory at runtime but you can easily pause the debugger and select any timeframe in order to check events and memory and CPU usage.

Additionally, you can take a snapshot of memory at any time during debugging of the application and check the number of references for each object, amount of memory etc.

clip_image007

The next set of tools you can find if you execute Start diagnostic tools without debugging… command.

clip_image009

These tools allow to collect information during runtime. Because these tools collect all information not in the debug mode, these data has better quality but you cannot check it in real time. Instead, the tools collect information about application until you stop them. Once they are stopped, the report abound the collected metrics is generated and you can analyze the data using dashboard.

clip_image011

Among all tools I would like to recommend Application Timeline. Thanks to this tool you can find problems with rendering and review the most critical parts of your application.

Written by Sergiy Baydachnyy

10/01/2015 at 8:23 PM

Visual Studio Tools for Unity

leave a comment »

Lots of developers use Visual Studio like the default code editor for Unity engine for many years and looks like, since Visual Studio 2015 release, integration between both products are stronger than before. Since Unity3D 5.2, Visual Studio Community Edition 2015 is the default Unity3D code editor for developers on Windows.

First of all, both tools have cross-product installations. If you have fresh PC with Visual Studio 2015 installed you can find that New Project dialog contains a new category there – Game. You cannot use this category to create new projects because there are just links to some popular gaming frameworks including Unity.

clip_image002

Selecting Install Unity, Visual Studio will help you to install Unity and Visual Studio Tools for Unity:

clip_image004

In case of Unity installer, integration even much better: users can select and install Visual Studio Community Edition directly from Unity installer:

clip_image006

Pay special attention that starting with Visual Studio Community Edition announcement, game developers can use all important Visual Studio features for free including extensions (plug-ins) and debug features. If you want to download VS Community Edition separately, you can do it visiting https://www.visualstudio.com/ web site.

Visual Studio Community Edition has some licensing limitations. For example, you can use it for small teams only (up to 5 people) but if you work in a big company you can use Professional or Enterprise version of Visual Studio. In this case Unity installer will recognize existing version of Visual Studio and propose to install Visual Studio Tools for Unity only that is a bridge between Unity and Visual Studio 2015:

clip_image008

So, using Unity installer or Visual Studio, it’s really hard to miss installation opportunity for Microsoft Visual Studio Tools for Unity. Let’s see how to use the tools themselves.

The good news that Unity3D 5.2 has native support for Visual Studio Tools. So, you should not add any packages or something like before. So, you simply need to create a new project or open existing one. To make sure that Visual Studio is the default editor you can call Edit->Preferences menu item and open Unity Preferences window that contains information about external tools including script editor:

clip_image010

On this step you can start working with your Unity project, create scripts in C#, objects, assets etc. Once you want to open the project in Visual Studio you simply need to use Open in C# menu item.

clip_image011

It’s easy to do and Unity will open your project in Visual Studio. Let’s look at some important features that you can use there.

First of all you can use Unity Project Explorer (Shift+Alt+E):

clip_image013

This window is similar to Project window in Unity and can present project’s files in the same way. So, if you need to find some files very quickly you can use the same way like in Unity. Unity Project Explorer and Solution Explorer show project’s files in different ways. Especially you can see that difference for large projects.

The next two windows allows you to override MonoBehaviour class methods very quickly. You can use Ctrl+Shift+Q combinations to call Quick MonoBehaviours window. Just start typing name of the method and the window will help to select the right one:

clip_image015

The second window you can call using Ctrl+Shift+M combination:

clip_image017

Using MonoBehaviour wizard you can generate several method stubs at once.

Two more features of Visual Studio Tools for Unity is supporting shaders editing and integration with Unity output. Thanks to the first feature you can see coloring syntaxes and formatting features if you are working with shaders in Visual Studio. The second feature allows you to see Unity errors and warnings in Visual Studio error window.

Finally, the most important feature there is Debugging. You can connect to Unity Debugger using Debug -> Attach Unity Debugger menu item. Select Unity Instance window will show available Unity instances and you can select any of them:

clip_image019

Or you can simply click Attach to Unity button on Standard toolbar.

clip_image020

Once Visual Studio is connected, you can open Unity editor and use Play/Stop features. Of course, Visual Studio supports breakpoints, allows to evaluate expressions and variables and other debugging features.

Written by Sergiy Baydachnyy

10/01/2015 at 8:19 PM

XAML tools in Visual Studio 2015

leave a comment »

Visual Studio is the best editor forever. So, it’s very hard to implement something new that can excite me but developers of Visual Studio 2015 made it and today I want to talk about several features related to XAML editor.

The first feature there is “peek window”. The feature can be used not just in XAML editor but in case of XAML it’s really valuable because it allows to do a lot of things that were not possible before. This feature allows to inject “dependent code” windows directly to my current window.

clip_image002

Thanks to that I can easily check styles even in generic.xaml, review definitions of controls, modify event handlers etc. And in order to do it I should not close my primary window.

You can call “peek window” using context menu or you can find this window using some features of Visual Studio 2015. For example, Visual Studio 2015 contains updated template editor. If you want to create a new template for any control you can use context menu and select Edit Template->Edit a Copy

clip_image003

If you use Application resources or Resource Dictionary, Visual Studio redirects you to the appropriate file. But in case if Visual Studio 2015 you continue to work with new template using the same window, editing the template in the designer and checking and modifying code using “peek window”.

clip_image005

Visual Studio 2015 applies color border to the visual editor in template editor mode.

One more feature in XAML editor is its ability to add named regions in XAML code like in C#. You can use the following syntaxes in order to create a marked region inside your XAML

clip_image006

As in C# you can collapse it:

clip_image007

You can use this feature in many ways: mark the existing code for some reason or create some templates for future work.

I showed three new features in XAML editor: peek window, updated template editor and marked XAML blocks. Let’s use these features to make coding more smoothly.

Written by Sergiy Baydachnyy

08/25/2015 at 10:21 PM

Posted in Visual Studio, Windows 10

Tagged with