>> [MUSIC] My name is
Charles. In this video,
I'm going to show you how to
use conditional breakpoints
to focus on the data and
values that actually matter.
That way, you can debug
smarter and fix bugs faster.
More often than not, your games
most crucial features are
the ones that present the
biggest debugging challenges.
Take this project, for example.
Spawning is one of its key mechanics
and I've tried to
improve that by writing
code that changes the SpawnRate in
response to the player's skill level.
The idea is that enemy
should spawn faster
when the player is doing well
and slower when the
player is lagging behind.
To achieve this, my logic
modifies an animation curve
that represents enemy
SpawnRate over time.
Here, the x-axis represents time
and the y-axis represents SpawnRate.
This graph represents a
linear progression in
which enemies will spawn
faster as time progresses.
However, that's just a
static, hard-coded example.
In reality, our graph will
fluctuate as the player plays
and there's no telling what it will
actually look like at runtime.
If it's working as expected,
the players should be
met with a challenging
yet manageable flow of enemies.
However, somehow I've
introduced a bug that causes
the SpawnRate animation
curve to fall below zero,
which results in a ton of
enemies being spawned.
That's no fun for the player
and especially no fun for me,
the developer who now
has to figure out
what in the world has gone wrong.
Looking at the code
that's responsible
for updating the animation curve,
we can see that it uses
an algorithm that applies
some modifiers to a
configurable base SpawnRate.
The key modifier here is
the difficulty modifier,
which is used to increase the
time in-between each spawn.
This is really good
information to work with,
but I'm not really sure where
to begin my debugging process.
The problem is that algorithms
are not my strong point
and I have no idea
what could be causing
the SpawnRate to spin so
wildly out of control.
I'll need to do some debugging.
Now, the standard approach is
to use debug.log statements
to get more information
about what's happening.
However, in this case,
we've got a lot of noises,
there's just too much
happening in the scene.
We could add some logic
to make our logging a
little more intelligent,
but then we just have a
bunch of debug code peppered
throughout our logic
and no one wants to maintain that.
Instead, we're going
to use a feature of
the Visual Studio
debugger that'll help us
quickly get more information
without all of this extra code.
Let's start by adding
a normal breakpoint on
the line right after
SpawnRate gets assigned.
Then let's attach
Visual Studio to Unity.
Perfect.
Now, switch back to
Unity and hit "Play".
This will cause the debugger
to immediately cause
the execution of our code on our
breakpoint just as expected.
Now that's helpful
because as we've covered
in our other videos about debugging,
we'll be able to inspect any
and all variables that
are currently in SQL.
But I'm not really interested in
inspecting those variables just yet.
At this point in our games lifecycle,
SpawnRate is being set
to a reasonable value,
it's working exactly
as I expect it to.
While I could poke around,
I don't know if I'd be able to
discern anything of importance.
What I really care about
is inspecting the code
when the bug occurs and
only when the bug occurs.
That's where conditional
breakpoints come in.
Conditional breakpoints
are a feature of
the Visual Studio debugger.
They allow you to pause
the execution of your code
when certain conditions
have been met.
This can give us a great deal of
additional control over
our debugging process.
Let's see it in action.
Back in Visual Studio.
Let's modify our existing
breakpoints so it pauses execution
when SpawnRate dips below
a certain threshold.
For example, a threshold that
we deemed to be unacceptable
or too dangerous for the player.
To do that, all we have to do is
right-click on the breakpoint
and then select "Conditions"
from the context menu.
This will present a breakpoint
settings block that appears
just below the line on which
the breakpoint is set.
From here, we have a couple
of options to choose from.
Let's expand the first drop down.
Our options are conditional
expression, hit count, and filter.
Conditional expressions represent
any logical condition
that you can think of,
so long as the values you
reference are in scope.
When using conditional expressions,
the breakpoint will be
triggered when your expression
has been satisfied or when
a value has been changed.
For example, I can
reference SpawnRate so that
execution pauses whenever
its value changes.
Hit count triggers your
break point whenever
the line has been executed
a certain amount of times.
This is great for loops that you
suspect have gotten out of control
and are iterating more
times than they should.
Finally, the filter option
triggers your break point
when specific low-level
conditions have been met.
There are a number of
predefined filters available,
such as machine name, process ID,
and thread name that
you can use to restrict
your breakpoints to select
devices, processes, or threads.
In our case, we don't need
anything complicated.
We'll just use a
conditional expression.
Since something is
causing the spawner
to spawn enemies way too quickly,
I suspect that SpawnRate is being
set to a ridiculously small number.
Let's confirm that suspicion by
adding a condition that triggers
the breakpoint when the value
of SpawnRate drops below 0.5,
then we can examine the other values
and try to determine what's going on.
This condition is possible
because SpawnRate
is in the same scope
as the breakpoint.
You may recall from
our debugging basics
video that you should
take care to add
breakpoints to the lines
of code for all of
the variables you want to
inspect are accessible.
In our case, SpawnRate is
a variable that's local
to the function where our
breakpoint is currently placed.
So we're good to go.
Let's play the scene until
our breakpoint is triggered.
[MUSIC].
Great. Our conditional
breakpoint worked.
The execution of our code
is pause at the point
where SpawnRate has reached
an unexpected value.
Now we can figure
out what's going on.
Again, I'm terrible with algorithms.
Hopefully, the solution
will be simple.
Let's analyze each variable
that's used in our dynamic
SpawnRate algorithm.
Base SpawnRate is a field that
can be set in the inspector.
It represents the base
SpawnRate of the spawner.
It should be set to a moderate value,
which it looks like it is.
Next, spawn enemies is an instance of
a scriptable object that
holds a list of game objects.
Here we're adding the count
to the base SpawnRate
in order to increase the
time between each spawn.
That way, the game becomes easier
when there are more
enemies in the scene.
Moving on, difficulty
modifier is another field
that can be set in the inspector.
Its job is to tune down the impact
that enemy count has
on the base SpawnRate.
The lower the value, the
harder the difficulty.
In this case, it looks
like it's way too low.
In fact, a negative value should
not be allowed here at all.
This is a common problem that happens
when you expose
properties in the editor,
especially when those properties have
an effect on your
games key algorithms.
Users will always
find a way to provide
values that fundamentally
break your logic.
That being said, being able to
parameterize your component
is extremely important
because you want to be able
to hand off tasks like
tuning difficulty to game
designers wherever possible.
Instead of restricting this
property to fix the bug,
we're going to make a
couple of quick changes
to guard against bad user input.
The first is the range attribute.
Range is a Unity specific
attribute that limits
the value of a property in the
editor to a predefined range.
Let's limit difficulty modifier
to a value between 0.1 and 1.
Perfect. Now, our game designer
won't be able to input
a game breaking value.
That's a great start, but we
still need one more check.
A dynamic SpawnRate algorithm
partially depends on elapsed time.
That means that given enough time,
SpawnRate will eventually dip
down into an unacceptable range.
Luckily for us, the
solution is as simple as
clamping SpawnRate between
two acceptable values.
This will allow us to provide
minimum and maximum values.
That's it, our game
is back to normal.
More importantly, we've limited
the ability for our game designer
or anyone else who modifies
the spawner component
to break our logic.
It was all thanks to
conditional breakpoints
in the Visual Studio debugger.
Without them, we either have to sift
through tons of log statements
or manually pause and continue
the execution of our code until
we reach the broken state.
Conditional breakpoints gave
us the ability to place
a breakpoint that pause
only when we needed it to,
which helps us close
our feedback loop
and dramatically speed up
our debugging workflow.
Best of all, it works the same way
across all Visual Studio products.
Whether you're using Visual Studio
for Mac or Visual Studio code,
be sure to take advantage of these
powerful time-saving features.
[MUSIC]
Wednesday, February 4, 2026
Conditional Breakpoints [4 of 5] Beginner’s Series to Visual Studio Tooling for Unity Developers
Connect your application to Azure using Visual Studio 2022
>> [MUSIC].
>> Hi everyone. My name is
Angelos and I'm a PM for.Net.
Today we're going to look
at how Visual Studio helps
me integrate my application
with Azure services.
We're going to look at how to get
our Kobe's configured correctly.
We're going to look at how to
emulate Azure services locally,
during local debugging,
we're going to look at how to
publish our application to Azure.
Finally how to deal
with the situation
of maybe I want to
connect my application
to different instances
of services for
different environments.
Let's jump right in.
Here I am in the
connected services tab,
and I can get back here by
just double-clicking on
the Connected Services note in
Solution Explorer at anytime.
This tab is split into two parts.
The bottom part is called
Service References,
and that helps me connect
my application to OpenAPI,
gRPC and WCF endpoints.
We're not going to spend
time on that today.
We are going to focus
on the top part,
which is service dependencies.
That helps me connect to Azure
services and SQL Server.
Right now, my application
is not connected to
anything and it says so right here,
and I'm going to click "Azure
Service Dependency" to get started.
Let's take a look at
some of my options here.
The first two items from the list
are referring to
Application Insights.
The first option is a local
only option that is only
available during F5 when I'm
debugging my application.
The second option is
letting me connect to
an actual live instance
of Application Insights.
Now the reason why on this screen,
I'm getting some
local options is that
because when I'm configuring
things to connected services.
I'm configuring how my application
is going to behave during F5.
Though, some of these options
are not going to make
a lot of sense doing published,
but they are not going to be there.
Following on, on the list and
next few options are
about Azure Storage.
The first two are two local
on the emulator options.
One of them is going to
run the Azurite emulator,
as it's called in a container,
the other one is going to
run the Azurite emulator
just straight up on the machine.
Finally, the third
option is to not let you
connect to Azure Storage,
real life instance.
Then moving down the list,
we have Azure Signal R Service,
which is again connected to a
real life service in Azure,
we have a local option for dealing
with applications secrets.
You can use the secrets
translation file,
which is the default way of keeping
application secrets outside
of your source repo.
Then we have the ability
to use Azure Key Vault and
actually Visual Studio
is smart enough to
let you use Secrets
Rotation locally,
and when the time comes to publish,
to switch that out
for using key vault,
we'll see how to do that later.
Then we have the ability to connect
to Azure app configuration,
which is just another
way of centralizing
all your application
configuration and
even integrate with keyboard.
That's pretty cool.
Then we have three
options for SQL Server.
SQL Server Express LocalDB,
that's a local only option,
it's very popular for doing local
development with SQL Server.
Then we have Azure SQL database,
which is connected to a
live instance of Azure,
Azure SQL database online.
We also have the ability to connect
your application to SQL
Server database on-prem,
maybe you have an instance on your
local machine on the network.
Then we have two options
for Redit cache.
One is a local
emulation option again.
It's going to run in a container.
The other one is going to connect
to a live instance of Azure.
Finally we have Azure, CosmosDB,
and much of identity
platform that lets
you achieve authentication
through Azure Active Directory.
I'm going to keep
things simple here.
I'm going to configure
my application to connect to
SQL Server Express LocalDB.
I click "Next" and I get to give
a name to my connection string.
I'm going to say my
connection to SQL.
Here Visual Studio
is helping me manage
that application secret the
connection string value.
Ideally, I don't want
it in my code base.
I can either by default would've
been the user secrets file,
or it can even integrate
with Key Vault.
This is basically the
equivalent of me adding
independency to Key Vault and
then putting the value in there.
I just don't have to do that
manually, VS can do that for me.
I'm going to keep
things simple and use
my local user secrets file locally.
Now we get a little summary
page that is going to
tell me what is VS
doing on my behalf.
It's telling me it's
going to get the right
makeup packet is spin up,
put the value in the
right Secret Store.
Because it's SQL Server,
it doesn't need to be paid a
code-based anyway so that's nice.
I can just click "Finish".
It will give me a little summary
of everything that it did.
Now it's telling me that my
application is configured
correctly to talk to
SQL Server LocalDB.
Let's do that one more time, and now
let's add a connection to storage.
Now I could connect to live
Azure Storage instance,
but locally I want to emulate things
so I'm going to pick the
storage Azure emulator.
I'm going to click
"Next" I'm going to give
my connection string and much
low my connected to storage.
Same options with the application
secret, I click "Next".
In the summary page it's telling me
that it's going to do the
same things as before.
This now an extra
step to also prepare
my codebase to be ready to
consume The Azure Service.
Didn't need a physical server,
but I do need it for storage.
It's really nice that Visual Studio
will just take care of
all of that for me.
Just click "Finish" here,
get my little summary of
exactly what's going on.
Now my application
is configured with
very few clicks to consume
Azure Storage and SQL Server,
and I'm ready to write
my business logic.
Now at this point, I
can go to "Publish".
I can create a new
Published Profile.
Pick Azure and offset this
Linux as my deployment target.
Here, Visual Studio is letting me
manage all of my Azure resources
without leaving the ID.
If I have multiple accounts
that I'm logging with,
I can switch over to
the different accounts.
If I'm logged in with
multiple subscriptions,
I can change the subscription.
I can search for instances that
already exist and pick them.
I can group things
by resource group,
which is very helpful for people
who are going to keep everything in
the same resource group when it
comes to a flat list
by resource name.
Of course, I can always
provision new resources
without leaving the ID.
Now I don't want to
do that in this case,
I already have an instance created,
so I'm just going to pick it from
the list and click "Finish".
Visual Studio now has
a published profile that is
ready for me to use immediately.
If I want to, I can just click
"Publish" and visuals are just
going to be the right thing.
It's going to build the app
and publish it to App
Service successfully.
That's why the status
is ready to publish.
But I've already told Visual Studio,
that I am connected to
SQL Server and storage.
It's smart enough to
know that locally,
I'm connected to basically
emulation options,
the storage emulator and
the SQL Server LocalDB.
It knows that's not going to work,
that's not going to
be successful when
I'm deploying an
application to Azure.
Because even though publishes
successful and the application
will be there when it starts to run
and tries to access the resources,
it's not going to be able to, so at
the bottom of the page here we have
our service dependencies list.
Again, the same list as we've had
before in Connected Services tab,
we now have it in this
Published Profile.
VS is telling me that this is
good to go as soon
as I configure it.
I just need to hook it up to
an instance that is available
in that environment.
I just click "Configure".
It knows that Azure SQL database
is probably what I want to do so it
has filtered the list
and just slap on
pre-selected for me,
I can click "Next".
Now I'm immediately in select an
existing instance to connect to.
It's the most common scenario.
That's why we default into it.
But like I said, you
can always provision
new Azure instances
without leaving the ID.
Here I'm just going
to pick an instance
that I already have
and connected to it.
I'm going to keep my
connection string the same.
I'm just going to
provide the username and
password that I know I can use
to connect to this instance.
When I click "Next",
it's going to give me
a summary of what it's
about to do and I'm
going to click "Finish".
It's giving me a running summary
of what it's doing right now.
Now this connection has
been configured correctly.
All I have to do, is go to
the next one and do the
same thing for storage.
Again, I can provision
the new instance,
but I don't have to, I can just
pick an existing one right now.
I'm going keep the same
connection string name.
Of course, the
appropriate connections
in value is automatically
figured out by VS.
I don't even have to worry about it.
I can just click "Next". Little
something that's going to happen?
Click "Finish". Now my application
is all set up and correctly
configured around this environment.
Now when I do publish,
application is going to end up
in App Service successfully.
Once you start running,
is going to access
the appropriate connection
strings with the configuration.
My application will be
able to run successfully.
Well, that was fun.
I hope you guys had
fun with me as well and
learn something new.
We're constantly adding more
support for more integrations.
We are adding support
for more Azure services
and we're dying to
hear your feedback.
Let us know what you
think, Tweet at us.
Let us know through
developer community.
Just know that we're
always listening.
Thank you very much. Take care.
Connecting to OneNote in the Cloud with Office 365 APIs
hi my name is Vijay Sharma and I'm a
product manager for Microsoft OneNote
team today in this video I'm going to
talk about OneNote api's for office 365
I will talk about how you can use the
api's and show you a quick demo of an
application that uses one or api's and
see some code behind lastly we will talk
about one or team's roadmap for
developers all right I am very glad to
announce the general availability of
OneNote api's for office 365 starting
today you can now write apps that can
access OneNote notebooks store in
onedrive for business sharepoint site
hosted notebooks and notebooks in office
365 groups now we already have the
consumer version of OneNote api's the
new version of OneNote api's for office
365 brings parity with a consumer api's
this is a great opportunity for
developers the office 365 market is
growing at a very fast pace and these
api's enable developers to build apps
for a vast majority of businesses and
educational institutions that use office
now this is a high-level architecture of
OneNote rest api with one node API you
can use poast
to create notebooks section section
groups and pages you can call get to get
the notebook hierarchy pages and page
content you can also use update and to
update a page and delete a page I will
walk you through each of these api's and
then show you a quick demo of how to use
the api's now before we start looking
looking at the code I just want to give
you a quick reminder that you need to
register your app with office 365 before
using the api's you can find
instructions to register your app and a
connect site a kms
one node and connect 2015 now here is
how you create a page in OneNote this is
a simple HTML that you can post to
create a page in OneNote what you see
here is a body which in this case
contains a header and an image when you
post this HTML to OneNote it will create
a simple page in one node with the title
and the image now one node has an
hierarchical structure you have
notebooks under that here section groves
under the rear sections and then pages
here is how you get the notebook
hierarchy you can use a notebooks
endpoint to get all of the users
notebooks similarly you can use the
section groups endpoint to get all the
section groups of the user and sections
endpoint to get all the sections but if
you want to avoid making a separate
network call to get notebooks and then
sections and section groups you can just
use expand at the very bottom of the
screen to get entire hierarchy in one
network call now here is how you get a
page now when you for getting a page you
can also pass you can also get we can
pass filters to get the most recently
modified pages now to update a page you
first get the page content and passing
the include IDs parameter set to true
what this will do is this will assign an
ID to each element in the content and
then you can use these IDs to update
that element in the page now let's
switch to a demo and see the code in
action alright to demo this api's let's
first look at a business problem I
travel a lot and meet a lot of customers
I exchange business card with the
customers and end up having a lot of
business cards so how can I organize my
business cards I'm going to use my
office lens app to scan a business card
and save it to my notebooks storing
onedrive for business okay I'm going to
use the office lens app to scan the
business card and save it into my
notebook here I scan the business card
and then I save it into my notebook in a
section called business cards I save it
over here now I was already logged into
my office 365 account and this business
card should get saved into my office 365
notebook now let's flip over to my
notebook that I saved this business card
you see there is an image of the
business card and you also see some
useful information like email phone
number etc OneNote actually extracted
this information from my business card
and saved the VCF file in my page this
is very useful information I can then
add my notes to this contact additional
meeting notes and save images right here
in OneNote now let's look at the code in
Visual Studio here's a sample code that
creates a OneNote page using the post
api's first I do and do create an HTTP
client set the default header and set up
the authentication we are going to use
OAuth authentication and set that as a
bearer token here is a simple HTML that
contains the image of the business card
notice that I have a div where I set the
data render method to extract and
provide a source image what this does is
it tells one node to extract useful
information from the image and the API
will analyze the image and see if is a
business card or a recipe or a news
article and extract relevant information
from the image this is very very
powerful now here is the post method of
the HTML now here I post the HTML to a
section in my notebook
by specifying the full URL of the URL
part and a multi-part content with the
HTML and the binary of the image I then
posted a sync and it will create a new
page in OneNote and extract the business
card from the image so this is how you
create content in OneNote
now this stuff was pretty useful but
wait there is more
what else can you do with the content
saved in OneNote what if I want to send
a quick email to one of my contacts
after the meeting so let's switch to
Outlook and see if we can send an email
to my contact now OneNote team build a
sample add-in for Outlook that goes over
all your notebooks sections and pages
and extracts business cards from my
notebooks and shows them as a contacts
right over here so let's fire off this
add-in and it will bring all my contacts
into OneNote so you see all my contacts
are over here and I can start writing
email to my contacts now this
information was very useful
imagine you meet somebody you scan their
business card and put into one node you
can start writing email to them within
five minutes now let's look at the code
behind these api's here is some
JavaScript code to call the OneNote REST
API to get the nose and sections I'm
going to use expand to get all the
notebooks sections and pages in one
network call once I get the pages I want
to get the page content here I call the
page content API and pass in the section
ID and page ID to get the page content
once I get the page content I have
walked through the HTML and see if the
page contains a VCF file as an
attachment if there is an attachment I
extract the email and name from the card
and show it in my user interface this
was pretty simple but very useful now in
our demo we use the OneNote REST API
endpoint to perform operations on
notebooks you can also use a converge
endpoint at graph dot microsoft.com to
access OneNote notebooks Microsoft graph
is a single converged endpoint to access
information about users groups files
messages calendar contacts tasks and
notes all under the same roof now the
graph API for OneNote are currently in
preview and should be available next
year so what's next from one noting we
are currently working on Arab enabling
live one note pages embedded on a
website this allows you to embed OneNote
pages in your website users can then
take notes in OneNote right from within
your website that would be really cool
we are also working on OneNote add-ins
this will allow you to build add-ins for
OneNote and publish them on office store
lastly we are also working on tools to
showcase apps and also some more samples
now if you have some suggestions please
reach out to us on a one north's user
voice page and let us know what you need
now I'm sure by now you must be really
excited about all the opportunities with
OneNote api's for more information it
related to one or api's please go to dev
godwyn or calm and get all the
documentation core samples videos and
blogs please engage with us on Stack
Overflow or Twitter let us know what
cool apps that you're building and thank
you so much
Continuous Builds with your GitHub projects using Azure Pipelines
hi my name is Edward Thompson I'm a
program manager at Microsoft working on
Azure DevOps and today I'd like to
introduce you to
Asher pipelines now available in the
github marketplace Azure pipelines is
the premier continuous integration
service for everything from open source
projects to enterprise software it
supports any language on any platform so
it supports your project whether that's
a nodejs app Java Ruby on Rails net or
heck even old schools see an azure
pipelines provides build agents for you
for Linux Windows and Mac OS so that you
can build your project on every platform
and they're hosted in the Microsoft
cloud so that you don't have to manage
them
best of all Azure pipeline's provides a
free pipeline for your project with up
to 1,800 minutes of build time per month
and it's even more generous for open
source projects as your pipelines
provides no limit on the build minutes
for open source and you get up to 10
pipelines in parallel for free that's
why I rely on Azure pipelines from my
open source projects especially one
project that you may not have heard of
its called Lib get 2 but just because
you haven't heard of it doesn't mean you
haven't used it Lib get to is the
project that get hosting providers like
Azure repos and github use to manage
pull requests and as a maintainer of an
open source project that makes up the
critical infrastructure of software
development it's crucial to me that we
have a robust and reliable continuous
integration service being able to
validate changes ensuring that pull
requests build across all the platforms
we support and that our tests pass for
every contribution is crucial for my
open source project and it's crucial for
your software projects too so I'm going
to show you how you can add Azure
pipelines as a continuous integration
build for your software project to build
and test the master branch of your code
and validate all requests let's take a
look at how easy it is to get started
with Azure pipelines
here I have a very simple project it's a
pocket calculator well sort of it's
actually a nodejs application that looks
like a retro calculator the kind that we
nerds had back in the day before the
phone in your pocket could calculate
integrals and of course I published this
project out on github I'm excited to
share it with the world in hopes that
other people will use it and maybe
contribute back to it maybe somebody
will find a bug in my code or maybe
somebody will theme it up so it looks
more like the pocket calculator that
they remember from their youth but if
I'm going to take contributions I need
to have a build pipeline configured so
that when somebody opens a pull request
I can make sure that their change is
billed and that all the tests pass and
the easiest way to do this is with as
your pipelines all I have to do to get
started is to go to the github
marketplace just look up in the top
banner of github calm and click
marketplace there are a bunch of great
services here to integrate with github
but for continuous integration builds we
want azor pipelines so I'll just type
that here in the search box
and then click on the search results I
can click on read more to get more
details about Azure pipelines and when
I'm ready to get started I can just
click to setup a new plan in the pricing
information I'm reminded that Azure
pipelines is completely free for open
source projects so just by selecting the
free plan you get unlimited billed
minutes across up to 10 simultaneous
build queues it's the most generous
offer for building open source projects
and it's free for private projects as
well private projects get a single
parallel job with up to 1,800 minutes of
build time included every month and if
you want to scale up beyond that you can
add additional private build agents but
for open source projects it's still free
for unlimited minutes when you're ready
to get started just click install it for
free on the next page you'll choose
where you want to install as your
pipelines you can install it directly to
your github account or into a github
organization which you might have if
you're part of an open-source project or
a company I've actually created an
organization for my application so I'm
going to select to install it there then
I can click complete my order and begin
installation on the next page you'll
need to verify that you want to install
as your pipelines this permission is
needed so that as your pipelines can
read your repository and write its
configuration into your github account
this adds the continuous integration
workflow and adds builds into pull
requests as a safety precaution you may
need to enter your github password here
to confirm this access
and finally you'll need to sign in with
your Microsoft account and if you don't
have a Microsoft account yet you can
just click to create one it's free and
easy but here I'll just type in my
username and password
and once I'm logged in as your DevOps
will set me up with a new account to
build my github project once my account
is created it will bring me to this new
pipeline designer here the first thing
that I need to do is make sure that the
correct repository to build is selected
that's easy
since I only have one in my organization
and that's my calculator app so I'll
click on it when I do that as your
pipeline's will analyze my repository to
try to figure out what kind of project I
have checked in and how to build it it's
detected here that I have a no js'
project which I do it also selects some
other project types in case it gets
wrong if I were using react or view I
could select those templates if I were
using webpack I could select that I
could even design my own pipeline from
scratch but of course I don't need to
let's take a look at the node template
that Azure pipeline's has recommended so
when I click on it it shows me the build
yeah Mille Azure pipelines uses a yamo
configuration file to describe the build
pipeline it's a technique called
configuration as code which is great
because you can check in the build
description right next to the code that
it builds so as your code changes and as
the build needs to change to support
that those changes to the build
configuration get version right
alongside your source code so as your
pipeline shows me this yanil up front
before it finishes creating the pipeline
this is an opportunity to make sure that
this matches what I expect from my
project and it is it's just building my
nodejs project with NPM so this is
perfect so to complete the setup I just
need to click save and run this actually
adds the yeah Mille file directly to my
repository on github and sets up an
azure pipeline's build that reads it
I could also select to use a pull
request which would let other
contributors to the project look at the
yeah Mille before it goes live and pull
requests are definitely a best practice
but since I'm just getting started with
this project and I don't have any other
contributors yet I'm happy to just click
Save and
run and commit it directly
and once I do that you can see that this
actually starts a build of our project
it's going to find a free Linux build
agent in our cloud hosted pool of build
machines it's going to download my
project's repository from github and
then it's going to run the build script
which runs npm install then npm run
build i can actually watch the console
output from the build as it runs to see
the progress as it goes and once it's
finished with all the steps you can see
that it's succeeded so that's great but
I can make this even more powerful by
tweaking the configuration for my
project the out-of-the-box template is
good but it's even better if we
customize it for example I have tests in
my project using the mocha framework and
I want to run them as part of the
validation that I want to perform on
pull requests so I can add this just by
navigating to my project on github I can
click this link right here in the build
output to go there then in github I can
select the yellow file that adjure
pipelines added for me and at the top of
the yeah Mille text I can click the
pencil to edit it and in the script
section right after the npm install and
npm run build commands i can add npm
tests that's the great thing about yamo
it's easy to change
all I need to do is scroll down to the
bottom of this page and type a quick
commit message in
and then click commit changes again
although pull requests are a best
practice I'm just getting things set up
so I'm going to commit directly and when
I did that github notified Azure
pipelines that there's been new content
pushed to the master branch and that it
should queue a new build with those
changes so if I move back over to Azure
pipelines you can see that this did
indeed queue new build for me if I click
on it and then go to the log view and
then click on the build log for the NPM
step
you can see that it did run my test
suite and that they all passed so that's
perfect
as I commit changes to my master branch
on github they're built and tested with
this pipeline but now let's see how this
actually works to validate contributions
through pull requests if I navigate back
to my project on github
I can go through the contribution
mechanism with pull requests let me
navigate to my projects controller
and then click to view it and when I do
one thing that I notice is that this
operation for addition is a little
strange plus a plus plus B if I'm not
familiar with JavaScript and how the
plus operator is both addition and
string concatenation that might look
like an error to me so I might want to
be helpful and contribute a pull request
changing it to just a plus B so just
like before I'll click the pencil to
edit this file and I'll change this
operation to something that looks better
and again I'll scroll down and I'll type
a commit message
but this time I do want to follow best
practices so I'll select this to create
a new branch and I'll give my new branch
a name and then I'll click propose file
changes once I do that github will
navigate me directly to the new pull
request experience where I can double
check my code and then click create pull
request and then again github will
notify Azure pipelines that I opened a
pull request and then it will start a
build against that pull request branch
to validate those changes
you can see it right here on the pull
request page that is turned yellow it's
in the process of running my belt if I
want to see it in action I can click on
the details to open up the github Status
page
then I can select to open this in Azure
pipelines
and by the time I do you can see that
this build has actually failed if I
click on the NPM task I can scroll
through the output to see what happened
if I scroll down I see that my addition
tests failed my test that adds two
numbers twenty one and twenty one is
supposed to return forty two but here it
returned to one to one and this one adds
forty two and zero and expects forty two
back but here I got four two zero it
looks like instead of actually doing
addition its concatenating these numbers
as if they were strings that's clearly
not right let me close this window to go
back to github and then go back to my
pull request
now as your pipelines has reported back
to github that the tests failed so I
have this big red X to warn me about
this this lets me know as a project
maintainer that there's a problem with
this pull request just at a glance so
even though that line of code looked
strange it was actually correct after
all and this pull request validation
build made sure that I didn't
accidentally break something know that
Azure pipeline's has given me this
helpful feedback telling me that this
contribution was not actually a good
change
I can iterate on the pull request if I
go to the files change to tab then again
I can click on the pencil to make
another change to this pull request
obviously the original code was correct
the plus a plus plus B coerces a and B
two numeric values and adds them instead
of treating them like strings and
concatenating them so I'll revert that
change
but if you're not familiar with the
finer points of JavaScript then this is
still a little confusing so I'll add a
comment to this code to make it clear
what it's doing and why
you
now this is a good pull request it takes
some code that was confusing and
clarifies it with a comment so again I'm
going to scroll down
and I'm going to type a comment for the
commit
and then I'm going to click commit
changes this will add a new commit on
the pull request branch so when I click
back to the conversation tab I'll see
this new commit and I'll see another
status update that shows Azure pipelines
is running a build it's looking at the
newest change to see if now this pull
request will build so again I want to
click through to details and then to my
build in Azure pipelines
and I'm going to watch it build again
you
and this time it succeeded just like I
expected I certainly hope that adding a
comment won't break the build so now I
can close this and go back to the pull
request in github
and now I can see that the pull request
has this lovely green checkmark next to
it instead of that ugly red X this
indicates that all the build validation
checks have passed and that Asscher
pipeline's has run all the tests in
other words it's safe to merge this at
least as far as what I've configured my
continuous integration bill to look for
so I can feel confident clicking this
green merge pull request button this
will merge the pull request into the
master branch and in a way that I feel
confident about the code quality
so now I have a continuous integration
build set up the builds whenever changes
are merged into the master branch and it
will build pull requests to validate the
changes before they get merged as a
maintainer of a software project this is
a level of sophistication that I expect
and I want people who are contributing
to my project to know that I'm following
these best practices with CI builds so I
can actually show this to them easily so
that they know the project is healthy I
can do this by adding what's called a
batch to my project page on github this
badge will show contributors that my
main integration branch is building
successfully and that all the tests are
passing it's a bit of a litmus test
really for open source projects and
really for any software project as your
pipelines makes it easy to add a badge
to your projects readme where it will be
shown as soon as anybody navigates to
your project on github to add one to my
project all I need to do is navigate
back to my build in Azure pipelines then
I need to click this ellipses and then
I'll select the option for a status
badge
when I click on that as your pipelines
will show me an example of my badge you
can see that it's green that means my
builds are currently succeeding which is
exactly what I want to see and it shows
me the URL for this image but even
better it gives me some markdown that I
can actually just copy and paste right
into my readme so I'm going to select
that and then copy it to my clipboard
then I'm going to go back to github to
edit my readme and add the markdown back
in my repository I'm going to click on
my readme MD to open it in the viewer
and just like before I'll click the
pencil to start editing and I can select
right here in the file where I want the
build badge to show up in my readme and
then paste the markdown right in
finally again I'll scroll down to the
committee area like before type in a
simple commit message and then commit
the changes
so now when I'm taken back to my
projects readme you can see this nice
green badge that shows everyone I'm
following best practices by having a
continuous integration pipeline for my
pull requests and for my master branch
and that Azure pipelines is keeping my
project safe so you can see how easy it
is to protect your project and keep it
building and tests passing which helps
you safely accept contributions whether
that's from the open source community or
from your co-workers and it's easy to
get started just go to the github
marketplace and select Azure pipelines
to build and protect your project
whether it's nodejs java.net core or
anything else it's free to start with
1,800 build minutes per month and a
single pipeline available at no cost for
open source projects it's completely
free with unlimited build minutes and up
to 10 concurrent builds if you want more
information about Azure pipelines
you can visit dev Asia calm and be sure
to follow us on Twitter we're at Azure
DevOps so again I'm Edward Thompson
thanks for watching and I hope that
you'll get started with Azure pipelines
for your project
Cortana Analytics Building a recommendations model in 5 minutes!
hello everyone my name is Luis Cabrera
and I work in the azure machine learning
organization but today we're going to
cook ourselves our recommendations model
one of the missions of Cortana analytics
is to in a sense democratize machine
learning we want to make sure machine
learning is available to everyone not
just to data scientists but also to
developers we want to make sure that
everyone has the capabilities to harness
the power of machine learning one way in
which were doing that is by providing to
you what we call machine learning api's
this machine learning api's are
completed services that you can find
today in the Cortana analytics gallery
these are already baked they use machine
learning capabilities but you do not
need to be a data scientist in order to
use them
today we're going to be talking about
one specific API called the
recommendations API let me start with a
story when I was a kid and I wanted to
watch a cook a cooking show in my native
country of Guatemala there were only two
channels that I could watch at any time
so my probability of getting the best
channel at any time was about fifty
percent and that was great but today my
children you know if you have a service
like xbox you really have over a hundred
thousand streaming options to prick from
which makes it very very hard to find
the content that you need so actually
for the Xbox we built recommendations
engine and in order desire to
democratize or to bring to the world
this capabilities we put these
capabilities together in the
recommendations API so let's get cooking
what you aren't going to need to create
a recommendations model is some catalog
data these are like the the items that
you want to sell for instance or that
you want to recommend you will need some
usage data which represent the previous
transactions that you have seen in your
application or you or your retail site
for instance so you mix these two pieces
together I will show you what these
files look like you you mix them in this
beautiful recommendations builder you
let it bake for a few minutes and then
you are ready to serve in your favorite
website or mobile application okay so
let's get cooking here so first of all I
am going to gallery dot Cortana
analytics com where I can see several
machine learning related resources for
you including machine learning AP ice so
if i click on machine learning api's it
will show me a catalog of different API
study we have available for you for
instance we have faced api's text
analytics computer business API etc but
today we're interested in the
recommendations API so I'm going to
select that one where you can now you
can see a description of the service
links to documentation and and so forth
you will notice that you can also sign
up for the service I have already signed
up so I am NOT going to do it right now
but I have to tell you that you actually
are able to sign up for ten thousand
three transactions per month enough for
you to be able to play with the service
and once you have signed up for the
service you can use the recommendations
UI which is in beta right now and i
actually have already opened the service
which is right here once you are in the
in the recommendations you I you can
create new projects let me create a new
project i will call it connect and this
project is going to be my container
where i can add the usage the catalogue
files and where i can later train my
model so it just created the the model
and step-by-step it asks me to add a
catalog file so i actually have a
catalog file that with transactions from
from the microsoft store actually so i
am going to use my catalog from the
microsoft store as you can see it was
able to upload the catalog now the
question that you may have is what does
that catalog actually look like let me
show you so that catalog has a very
simple format it shows you that there is
a items the identifier for each of the
items in the next row it will give you a
description of the items and then a
description of what type of item is in
my catalog so in this case these are all
items from the microsoft store for
instance so you know i want to be able
to recommend to a customer when they are
buying one product what other type of
product will make sense for them to to
purchase as well it will allow them to
discover those items faster as well so i
need information on metadata about my
catalog and then i also need information
about each of the transactions
in in column a here I have the actual
identifier for users and in in column B
here i have the identifier for
particular products so for instance in
in the first row here I know that person
with id3 BFF DC blah blah blah but item
QR 2000 11 which may be a piece of
software or a piece of hardware for
instance so the system is able to take
the the catalog and then the usage files
and I will just add a usage file here
and you can see that it's starting to
upload the usage file as well so so once
it has both of these pieces of
information it can crunch the
information to create a recommendations
model for you I should point out that
usage files should be less than 200
megabytes in size and if you have more
than 200 megabytes of information you
are allowed to upload several files okay
so once once you have the catalog and
usage file you can actually create a new
build the the first file uploaded and I
am in the process of uploading a second
first once the files have uploaded to
the system you can create a new build
and you can pick a type of build we have
two types of builds recommendations and
frequently bought together we also have
a ranking bill but that's an advanced
feature that you can check in the
documentation for it now so let's say
that we want a recommendations build and
then all I will have to do here is is
click build and then this is going to
take about 30 minutes
okay so after the 30 minutes we are able
to see our build and we can actually
score it so in this case I have to tell
you that I do that images and you don't
see how i am adding the images but when
you select an item you will be able to
see the recommendations for that item so
in this case we have Mike Wazowski the
Infinity figure and you can see the the
recommendations for that item right here
are all that infinity figures which
makes sense you know if a child by its
design and they may want to buy the
other ones as well so if someone on the
other hand were to buy a game like
Assassin's Creed which is a more mature
game we will expect to get
recommendations that are a little bit
more mature right so sage Anarchy Reigns
men in black fuse which makes sense
right these are other games for xbox 360
which people purchase when they when
they purchase the assassins creed game
so in this case you can see how as I
pass one item to the recommendations
engine it is able to return to me all
their items now this is all great and
you already have a model by now but I
have to tell you that if you go to to
the gallery you are also able to
download the coals to do exactly what we
did in that you I it's actually pretty
simple and I'll walk you through it this
is this is actually the exact code that
you download in the sample so all you
need to do is just like with it in the
UI you need to create a model which is
what we're doing there on the only
create model call then you need to
import a catalog and a usage file which
which are the selected lines right there
once you have imported those lines you
want to trigger a build which is done in
the in the next line
so you want to build a model you pass at
the model ID and then the rest of the
code really is in a tight loop just
waiting for that bill to be completed
once the build is completed you you need
to update the model to use that build ID
or that build as the default build this
will allow you in the future to have
several bills and then select which one
is the one that that your model should
be returning recommendations from so it
was actually very simple and you notice
how we were able to use the UI to create
a recommendation sending but you can
also automate it in code as well I
should point out that you can retrain
the model as you get new usage data as
well I should point out that there is
other related content that you may be
interested in we actually gave a
presentation on intelligent retail
scenarios at the Cortana analytics
workshop and it's on channel 9 so this
is the link and you can find me at Lewis
Scott microsoft com and that's my
twitter tag as well
thank you so much and it has been a
pleasure spending some time cooking with
you
CUDA Support in Visual Studio Code with Julia Reid
Hi, my name is Julia, I'm a program manager on
the Visual C++ team at Microsoft. Today I'm going
to show you some of the new CUDA development
support that we have in Visual Studio Code.
CUDA is a parallel programming platform that
allows developers to interact directly with
the GPU, achieving massive amounts of
parallelism. NVIDIA and Microsoft have
been partnering together to light up the CUDA
development experience in Visual Studio Code.
Last week we announced in the 1.3 release of
the C++ extension support for CUDA IntelliSense,
so that's currently available. But you do have
to have the insiders build of Visual Studio Code
for that. It will be released in the official
Visual Studio Code builds later in May. Further
on the horizon we have Nsight Visual Studio Code
edition coming. So you might be familiar with
Nsight Visual Studio edition, or Nsight Eclipse
edition. Now there is Nsight Studio Code edition
which will allow you to build and debug CPU and
GPU code in Visual Studio Code. Today I'll show
you the newly available CUDA IntelliSense and
give you a sneak peek of what's to come with
Nsight Visual Studio Code edition, which will
be available in the marketplace in the future.
So I just opened Visual Studio Code insiders on my
Windows Surface Book, but I actually want to do my
CUDA development on a GPU-optimized VM, so
I've already spun up an NC-series VM in Azure
and I'm going to connect to that VM using the
remote SSH extension in Visual Studio Code,
which I'll show you how to do in a second here,
and then once we're connected to that virtual
machine then I'll show you all of the cool
new CUDA development support that we have.
So in order to install the remote SSH extension,
you can do that in the marketplace. It looks like
this. I already have it installed, but this is
where you would install it for the first time if
you need to do that, and then once you have the
remote SSH extension installed you'll see this
remote explorer icon on the left. So you can go
ahead and click that, and here I'm looking at SSH
targets. I could also look at remote containers
or WSL targets since I have those extensions
installed as well, but we're interested in SSH at
the moment. And this is a list of SSH targets that
I've previously connected to with VS Code, but you
can add a new one by clicking on this plus button.
So I'm going to connect to this last one in the
list because that's where my NVIDIA CUDA tool kit
is installed. That's my NC-series VM and Azure and
you can see I have my matrix multiplication sample
CUDA project on it. So I'm just going to hover
over it and click connect to host in a new window,
and this is now opening my remote
window in Visual Studio Code.
It'll prompt me for my password.
There we go, let me go full screen here.
All right, so I can tell that I'm developing in
my remote environment by checking out the green
rectangle in the bottom left-hand corner. So here
I can see the IP address of the remote target that
I've connected to. So let's open a folder. And
it's important to understand that the remote
SSH development experience in Visual Studio Code
works differently than it does in Visual Studio,
so nothing is copied over from my local machine,
everything lives on the remote target itself.
So I'm going to be opening a sample
matrix multiplication project today and
this matrix mul project comes
with the NVIDIA CUDA toolkit,
so if you install the NVIDIA CUDA toolkit
then you'll also have this matrix mul project
on your system. So it'll ask me for my
password one more time, since I'm opening a new
folder
and now it's activating extensions. So I have
some extensions installed on the remote machine.
Let's first just check out our environment and
our VS Code setup for this remote SSH target.
So if I go over to the extensions marketplace
I'll see which extensions I have installed
locally. So that's on my surface book and
then which are installed on the remote target.
And here's another quick tip: you can just
click on this cloud icon if you want to install
the extensions that you have on your local
machine. If you want to install those on the
remote machine just click that icon and then
select the ones that aren't already installed,
hit ok. That way you don't have to
search for them again in the marketplace.
So the first thing I have installed here is the
C++ extension, so this is what you're going to
need in order to get that new CUDA IntelliSense
that I've been talking about, and quick reminder
that currently the CUDA IntelliSense is available
with the latest version of the C++ extension plus
the insider's build of Visual Studio Code, but it
will be coming to all builds of Visual Studio Code
later in May. And the other extension I have
installed here is the Nsight Visual Studio Code
edition extension. So this is really exciting
new stuff. Some of you might be familiar with
Nsight Eclipse edition or Nsight Visual Studio
edition. So what NVIDIA and Microsoft have
been partnering together to build is this new
Nsight Visual Studio Code edition extension,
and this will bring build and debug support for
CUDA programs into Visual Studio Code. This is not
currently available to the public, but
it will be available in the marketplace,
so keep an eye out for it and you can
actually sign up for early interest
and get updates on when it will be available.
I'll have a link for that at the end of the demo.
So now if I go to my project and open my
matrixmul.cu file you'll see that we have
syntax highlighting and semantic colorization
for this CUDA file and that's all brand new. So
you'll also notice that all of the C++
IntelliSense features that you have for
C++ files, you also have those on CUDA files.
For example, we have things like autocomplete
we have quick info, so if you hover over a
variable you'll get some information about what
it is and the type information. We have signature
help, so if I start typing MatrixMulCUDA, I can
see here in the completion list some information
about the signature. If I keep going with that then
I'll get parameter help, so I know what parameters
this function accepts and some information about
what the function is. The C++ extension also
supports things like find all references, so if
I right click on a variable and select find all
references then it'll search across the project.
I can also rename the variable and you can
actually do shift enter to preview your
results before actually making any changes and in
this refactor preview here you'll see all of your
confirmed semantic matches automatically checked.
If there had been unconfirmed matches, things like
a text match but not necessarily a semantic match,
so if it's in a comment for example, then those
would also appear here and you'd have the option
to select them before confirming the refactor.
All right, so that's a little preview into
the CUDA IntelliSense that we just released
but what about the build and debug support?
So that will be available with the Nsight
Visual Studio Code edition extension in the
marketplace soon, but I'll give you a little
sneak peek as to what that experience will be
like. So in our project we have a task.json file
and this is where we define our build tasks.
So you can see that we have two tasks here
for this matrix mul: project one is build and
the other one is rebuild, which triggers a make
clean before building the project. Now to run these
tasks all you do is select terminal run build task
or you can do control shift b because we have
rebuild marked as the default one. ctrl shift b
will trigger a rebuild, so in our
terminal we see that it ran make clean.
And there we go, and now we have our executable
and our debugging files. So task.json holds our
build configurations similarly launch.json which
is also in your project's .vscode folder that
holds your debug configurations. So if I open that
right now, I don't have any debug configurations
defined for this project, but if I click this add
configuration blue button, then in this menu I have
the option to add a CUDA debug configuration
which will invoke CUDA gdb on my Azure VM. So
I'll select that so all we have to do here is add
the name of the program, which is just workspace
folder
and we don't have any arguments.
So now if we go back to matrixmul.cu and let's
set a few break points. Let's first set one
in our CPU code in our main function,
and let's set one in the GPU code as well.
Cool, so now if we start the debugger by hitting f5
this will invoke CUDA gdb on the Linux VM.
So we've hit our first breakpoint, and on
the left here we have our local variables, our
registers, and we can add variables to watch, we
can look at our call stack and see which
breakpoints we have set in matrixmul.cu.
So remember right now we're just debugging the CPU
portion of the code and we can step through and
watch the variables change as we iterate
through the program and then let's continue
running, and the next breakpoint we hit
will be in the GPU portion of our program.
There we go, so now we can see how the registers
have changed, our local variables have changed
and in this output in the debug console you can
see what our focus is. So remember that GPUs are
highly parallel processors and the specific SM
warp and lane within warps that you're looking at
that's called our focus. Now we can actually
manually change the focus that we are currently
debugging and you can do that in the status bar
by selecting this cuda sm12 warp 0 lane 0 button
and then you can enter a specific SM warp or lane
numbers. Let's say we do lane one and hit enter.
So now again in the debug console you
can see it says it switched our focus.
This way we can debug specific portions of the
code regardless of which subset of SM warp or lane
the issue is on. Another cool feature about
the VS Code debugger is that you can edit
breakpoints that they have conditions. So if we
do when let's say when tx is zero and ty is two.
Then the next time we hit this breakpoint
tx and ty should match the values that we
specified in the condition. Which they do: tx
is 0 and ty is 2. You can also use the debug
console to execute CUDA gdb commands as you
would when debugging from the terminal. You
just put a backtick first and then info cuda
kernels for example and then you'll
get information about the cuda kernels.
Let's disable our breakpoints.
And continue running the program.
And the debugger exits successfully.
So this is a sneak peek into the Nsight
Visual Studio Code edition extension
that will be coming to the marketplace in
the near future. If you're interested in
Nsight Visual Studio Code edition and want to get
updates about when it will become available you
can sign up with NVIDIA and join their early
interest list. Thanks for watching this session,
I hope you're excited about the future of
CUDA development in Visual Studio Code.
Be sure to check out all of the live C++
sessions at Pure Virtual C++ on May 3rd.
Thanks!
Dashboards in Visual Studio Team Services
hi my name is Karen Inge and I'm a group
program manager on the Visual Studio
cloud services team today I'm going to
talk to you about dashboards it's a
brand new feature that we just shipped
in visual studio team services and team
foundation server update one so what
I'll show you today is really what
dashboards are I'll show you what's new
dashboards are customizable canvas that
replace your team overview page that
allow you to visualize the progress and
status across your team project I'll
show you the capability to do multiple
dashboards so in the previous home page
you really could only have one you can
only have a small section to pin new
widgets and you couldn't customize
anything else on that page in the new
dashboards you can have multiple
dashboards one for your sprint overview
one for your stripping features one for
your code health one for your active
bugs anything you can imagine the next
thing I'll show you is having a
customizable canvas previously you
couldn't remove any of those widgets and
you couldn't lay it out the way your
team wanted to what we've done is we've
made every single widget on that board a
hundred percent customizable so what you
can do now is remove add or configure
any widget the way you want the last
thing I'll show you is a new set of
widget capabilities that we've
introduced to the board and into the
catalog couple of those as teasers are a
query tile that lets you turn red or
green depending on the threshold of bugs
or even a sprint overview widget that
shows you your stories that are in
progress so before we dive in let me
show you what you used to have so this
used to be the old team overview page
inside visual studio team services there
are a couple things that you couldn't do
this page you couldn't remove the top
blocks if you didn't want them there or
if your team didn't use sprint burn
downs your capacity there is no way to
remove them and now you can this is just
a sneak peek at what the new dashboards
look like if you're a team admin on the
page you'll start to see that there's a
green plus button that plus button
allows you to add multiple dashboards
another thing you'll see is if you hover
over any widget you can start laying
them out the way you want or you can
configure them to show the data you want
the last thing I'll show you is these
new widgets so three of them are shown
here one of them is a marked
widget and it really lets you be
creative with what you want to show with
your team text images or links the other
one is the sprint overview widget and it
allows you to see stories that are in
progress and which ones haven't started
yet the last one I'm showing you here in
green is the query tile and it triggers
green because there are no block tasks
on this board great let's start and show
you the demo now so here we are at the
default dashboard that you have when you
create a new project there's a few
things that you can start seeing on the
dashboard first there's kind of a
Welcome widget it shows you a tour
across our product there is a query
results widget that actually is bound to
the open user stories there's a work
widget that are your quick shortcuts to
the different work hubs within the
product you can quickly get to visual
studio your team members open user
stories create a new bug or a user story
directly from the dashboard or your
sprint burndown by default when you
create a new project this is what you
get let me show you what it looks like
to build a new dashboard so let's create
a new dashboard called sprint overview
okay what that does is it creates a new
dashboard that's really a blank canvas
for us the first thing I want to do is
go to the widget catalog I can see a
number of widgets in the catalog here's
one that looks interesting I'm going to
create a sprint overview widget that's
already bound to my sprint I can see
that I have 11 work days remaining and
about 33% of my stories are complete the
next widget I want to add is a markdown
widget I want to tell other people what
this team is about so let's go for the
Marchon widget let's go ahead and add it
now I'm going to go ahead and configure
it so by default every configuration of
the widget shows you a live preview what
you'll see we have some markdown text
here and you're not familiar with
markdown you can learn more about the
markdown syntax I'm going to go ahead
and add a bunch of different things so
in this team this doesn't quite fit in
that widget view I'm going to make it a
2x3 widget you can start seeing things
like upcoming links links to wiki's and
even including images let me go ahead
and save that let's add a few more
widgets to
at the same time so the coat aisle looks
interesting the new work item widgets
let's do query results in a query tile
let's go ahead and add a burn down as
well I'm gonna add all those widgets at
once so you can see that the burn down
is already configured because my Sprint
is configured for the coat I'll let me
configure this to be bound to my master
branch what it shows me is the number of
commits in the last seven days I'll bind
my query results widget to something
else so if I go into my shared queries
look into my current iteration I want
this to look at active tasks what I want
here is I really just want the ID and
the title so I'll go ahead and configure
those columns to show what I need the
last thing I'll configure here is the
query tile I want the query tile to show
my active bugs so if my active bugs are
less than 10 I wanted to highlight green
let me actually go ahead and add in one
more query tile widget let's add the
resolved bugs here so if my query tile
shows my resolved bugs and if those bugs
are greater than zero since I don't want
to hold any debt it actually triggers
red and now what I can do is just lay
out my my dashboard let me make my mark
down widget here since I'm to explaining
what my team does I'll do my iteration
and burn down let me grab my coat I'll
move it down to the bottom I want my
active bugs here we trade the order here
and my resolve bugs now what I want to
show you is how to add charts I want to
go into my build hub and I really want
to get a rolling history of the builds I
can go ahead and see my CI build here I
get a new option to add that to my
dashboard I'm going to add that to my
sprint overview if I go back to my
dashboard you can see that the CI build
is now available and I'll drag it here
and I can see that I've had to build
failures in the last set of builds the
last thing I'll do is go to the work hub
what I want to do is I want to make a
chart that shows bugs assigned to users
on my team I'm going to go ahead and
create a new
I went to the queries hub then the
charts hub and now what I'm going to do
is select one of the shared queries what
I want to do is active bugs and I want
to create a new chart so the pie chart
feels like the right one that I want to
use and I want to see all the active
bugs assigned to people in my team I can
go ahead and make the colors really
customize to what I want it to be it's
kind of like this set and I'll go ahead
and create that new chart
the last thing I'll do is I want to add
this chart to my dashboard and if I go
back to my dashboard
I now really have a beautiful sprint
overview dashboard that lets me quickly
see where I am in the sprint how many
active bugs I have what my build history
look like and even the commits in the
last code branch thank you so I hope you
enjoyed what you saw in the demo go
ahead and try it out if you're curious
about more every three weeks we actually
publish new features to visual studio
team services you can find those
features on visual street comm under the
news section so keep up-to-date with
dashboards and widgets if you have any
feedback or you love what you're seeing
feel free to reach out to me at twitter
at karen k lou i love to hear it thanks
for joining today
you
Debug faster with IntelliTrace in Visual Studio 2022
[MUSIC].
>> Hi, my name is Mark Downie I'm
a Program Manager on
the Visual Studio Production
Diagnostics Team.
Today I'd like to talk to
you about IntelliTrace.
One of the weaknesses of
traditional or live debugging
is that it only understands your
applications current state.
We have very limited
data about past events.
To help you may decide to send
login flow to the output window.
You either have to infer
these past events based on the
applications current state,
or you could recreate these events
by rerunning your
application over again,
but this tends to be
really time consuming.
IntelliTrace is a Visual Studio
Enterprise feature that expands on
the traditional notion of debugging
by recording specific
events and data.
These events might include
module load activity or web
requests or breakpoints.
IntelliTrace then lets
you switch between
traditional or live debugging
and IntelliTrace debugging,
allowing you to see what
recorded information you
might have missed without
forcing a restart.
Let's see this in action.
I have this ASP.NET application.
It is an open source
application and I'm
going to use IntelliTrace
to help me keep
track of very important
events as I get deeper and
deeper into this debugging
and diagnostics session.
I'm going to go ahead and hit
"F5" and start debugging.
That will rebuild my application.
It will also start the
application for me.
It will start running
the application and load
a bunch of symbols so that
I can debug correctly.
Before I start
recreating the scenario,
I want to debug,
I'm going to go ahead and set
some strategic breakpoints
that'll help me with
my session here.
I'm going to go ahead and set
a breakpoint here at line 69.
I'm interested in the
whole action of going to
get comments for each
of the posts here.
I'm going to hit
"Control F12" which will
take me to definition
of this method.
Yeah, I'm really interested in
the data I pass to this method.
I'm interested in seeing
post ID or comments.
Let's take a deeper actually
passed those same values onto get
comments for hit "Control
F12" on line 437.
Again, this is the same
data being passed again.
I'm going to go ahead
and pass over this.
I don't need a breakpoint here.
Control F12 here takes me to
some interesting points here.
I'm interested in
seeing what the data
I get back from this method here.
That's really
interesting on line 1360
and certainly before I
returned this method back,
I'm interested into seeing if
actually even get any data here.
Let's go back to the way we
started the blog post controller
because we'll be making our way
back to the top of the call stack.
I'm certainly very interested
in if I have any blog posts and
taking a quick review there.
I'm going to go ahead and recreate
the scenario I'm debugging.
Hopefully that'll mean I hit
a breakpoint perfect
at my breakpoint.
Now this opportunity, obviously
I can review some data here,
and yeah everything seems to
be working as I would assume,
I can check values and
variables that have
been passed in at this moment.
I can check everything that's
typically what I would
expect at a breakpoint.
Fantastic. Let's keep going
as we hit 'Continue'.
We hit our next breakpoints,
which I strategically put
in another method here and
I can check the values being
passed again heating "Continue".
Again typical of what I'd expect,
I can take the date which is
back in February of 2020.
Perfect I can go here and see
exactly what information I
returned for comments I got
zero there and hit "Continue" again.
Now this is only just five.
I've only hit five breakpoints,
but you can imagine sometimes you
get several layers deep here.
You can decide at this moment
you'll notice right at the top,
what's lit up here are a
couple of additional icons.
Now these are the
IntelliTrace, step back icons,
which essentially say to you,
you have the opportunity
to go back in time.
I'm going to go ahead
and hit the "ALT,
Open Brackets", which is
the step back shortcut.
You'll see now I've changed
slightly Visual Studios,
change the top part.
Now he's describing the I'm
in historical debugging mode.
It's saying that there are
participating windows that
are also historical
debugging for me.
It's also giving me
the opportunity to
return to live debugging
at any moment.
If I look at the bottom here,
I've got autos in
historical debugging.
I've got Watch in
historical debugging,
so I can potentially add things.
They've got locals in
historical debugging,
and my Call Stack is also
historical debugging.
Instead of assuming I'm in my
controller and interaction,
it now sees that the last
time I was in this moment,
I was actually in
internal get comments,
which is the top of the call stack,
which corresponds currently
to the method I'm in.
I can take another step back.
I can hit "ALT Open Square Brackets"
again and take another step back.
I get to see now
the context of the moment
I was at this breakpoint.
Now notice I've still got this value
because obviously that
would have been executed,
forget date for entry on line 1359.
However, after this or these
values are all null because
again, there hasn't executed.
IntelliTrace has taken the snapshot
at this moment in time and
associated it correctly
with the line
I was at when the
snapshot was taken.
I can keep going back to these
moments that are important to me.
Again, going back to get comments,
I can see the values
that were passed in at
the strategic moments that were
important to my debugging session.
Now I no longer have to
remember all the details about
every single moment that led to
the era or the problem
that I'm investigating.
I can use breakpoints not
only as pausing moments,
but as moments of collecting data
that might be helpful to
me later down the line.
I can continue to go back
in time at this moment.
Or I can return to
my live debugging,
which means I'm going to basically
continue with what is
traditional live debugging.
I'm now back to the
yellow highlighted
line saying that this is the
next line to be executed.
What is also really
important is that you can
use the diagnostics tool
Windows to pick any of these
previous breakpoint moments.
If these previous
break and step moments
that allows me to hydrates
on past historical moment.
You can go to the debug
menu item Windows,
and Show Diagnostics Tool.
This opens up the diagnostics tool.
If you look at the events,
you will see a series of
these snapshots that I've taken
at each of these breakpoints.
I can choose to activate any one of
those by simply selecting
and clicking "Activate".
I can go back to a specific
historical moments
in time that I know that's
important to my current debugging.
Today I was able to demonstrate
how IntelliTrace is able to help
Visual Studio Enterprise users
expand on the traditional
notion of debugging.
IntelliTrace step back
can save you time
when you want to see the
previous application state,
but want to forgot that dozens
of restarts necessary to
get your app back into
the desired state. Thanks
for joining today.
Debug C++ with WSL 2 Distributions and Visual Studio 2022
hey everyone my name is erica sweet i
work on microsoft c
plus plus team and i'll be joined in a
few minutes by craig lowen
who works on wsl or the windows
subsystem for linux
and we've teamed up today to show you
the new wsl2 toolset for c
plus plus development in visual studio
2022
which lets you build and debug c plus
code
on wsl 2 from visual studio without ever
adding an ssh connection
so the first thing you'll need to do is
set up your wsl distro
to ensure you have all the required
build tools installed
so you'll need a c plus compiler c make
an underlying build tool like make or
ninja rsync
zip and gdp and since i'm using ubuntu
i can install these all using the system
package manager
i'm now ready to open my c plus plus
code in visual studio 2022
i'm using a cmake project which is our
recommendation for c
plus plus cross platform development and
my source files are located in the
windows
file system thanks to bullet physics for
creating bullet 3 which is the cross
platform 3d physics library that we'll
be using in this demo
i'm using visual studio's new cmake
presets integration
which will activate automatically
anytime you have a cmgpresets.json file
at the root of the project across the
menu bar you'll see that i have three
drop downs and the drop down on the left
is my active target system
so i can build and debug the same
project on windows
remote systems and on wsl from the same
instance of visual studio
which makes this a great option for your
c plus cross platform development
and when you select wsl 2 visual studio
will automatically use the new wsl2
toolset
for configuration and build when you're
targeting wsl
you'll have a native intellisense
experience so for example
if i were to go to document on this
header file
you'll see that visual studio is
automatically copying my system headers
from the linux file system
over to windows for a native
intellisense experience
and with that i'm going to pass it on
over to craig to build and debug this
project on wsl wsl2
thanks erica so over here on my machine
and literally all we have to do to get
started
is hit f5 from here everything is
compiled and built
inside of linux using the windows
subsystem for linux and we use
gdb to connect to visual studio for a
full debugging session
so our app started and you'll actually
notice that this is a linux based
gui app which wsol now has support for
in the windows insider preview channel
you can learn more about that at dot ms
wslg
what really gives this away is the linux
based tiling here at the top so you can
see that these
this chrome tiling is uh gtk based
indicating that we are
actually running this directly on linux
in a linux instance
so i can go ahead and interact with my
app i'm going to drag this robot around
and hit d
to trigger a breakpoint and i can use
all of my favorite visual studio
debugging techniques directly in here
i can take a look at my call stack i can
take a look at these
environment variables and what their
actual variables are
using my regular workflows that i would
use inside of visual studio
this is hugely exciting to unlock the
potential to use your favorite
tools at using visual studio to debug
run and develop
your c plus based apps inside of linux
as well even though you're using a
windows based machine
and exciting enough if we go ahead and
close this just as eric mentioned
i can go ahead and use my local machine
and target this back
to windows just by clicking that drop
down button so what's actually happening
behind the scenes to make this possible
well if i go ahead and hit build you
will see that i
have a line here saying starting copying
files to a remote machine
what we're actually doing is we're
creating a twin of your copies that are
stored on your windows drive
inside of the windows subsystem for
linux in your linux file system
the reason for this is that wsl 2 runs a
lot faster when your files are in the
linux file system
it can actually be up to 3 to 20 times
faster than wsl1
on top of that you get the added bonus
of wcl2 which includes a full linux
kernel
and 100 system call compatibility
letting you do fun things like
run linux gui apps for example and so
we can pop over to my terminal window
here
and you can see that i have this project
open inside of the dot vs folder
in my home folder on linux this is what
is being copied over using rsync so only
incremental changes
are basically transferred as you develop
if you want to learn more about this
project you can take a look
at the full blog post explaining these
changes in the links in the description
below
as well as links to the full code for
this repository
um morse presets wsl docs and the wsl
repository
as well where you can find any technical
issues or feedback that you might have
thank you so much for tuning in
Debugging Basics [1 of 5] Beginner’s Series to Visual Studio Tooling for Unity Developers
>> My name is Charles,
and in this video,
I'm going to show you how
to use the debugger in
Visual Studio to get a
better understanding of
what your code is doing at runtime
so you can fix bugs faster.
If you'd like to follow along,
the example project used in this
video is free for download.
Unity comes with a rich set of
features that you can use to
implement game mechanics and
create stunning visual effects.
Its physics system can simulate
almost any physical interaction,
and its visual tools like
Shader Graph and the Universal
Render Pipeline can be
used to generate an extremely
realistic or stylized
look for your game.
When coupled with its
scripting engine,
there's no limit to the variety
of things that Unity can achieve.
However, as great as
these features are,
they tend to slow down the
process of debugging your code.
Let's take this project, for example.
As you can see, it's a
relatively small game
with a few simple mechanics.
We have a third-person view
of the player and we can
perform various attacks against
the enemies that are
spawning around us,
my favorite which is this really
cool shooting mechanic where
the camera moves in over the
player character's shoulder
when her gun is drawn.
Very cool, except it has one problem.
While everything seems
to be working fine,
the console is filled with errors.
Let's pause the game
and take a closer look.
At first glance, we can
see that this error
is being caused by a Null
Reference Exception.
More specifically, if we click
on the error in the console,
we can see that this exception
is occurring somewhere in
this SendDamageMessage method
in the ParticleCollisionListener
class.
Let's go ahead and open
that up in Visual Studio.
Somehow, a variable in
this method is inadvertently
being set to null.
In programming, null
values are very bad.
They represent a void or
black hole in your code,
so we'll need to account
for that in this logic.
But we can't do that if we don't know
which variable is being set to null,
so we'll need to do some debugging.
A common approach to
debugging in Unity is to use
log statements to reveal
exactly where your code
is doing in the console.
Let's add a few calls to Debug.Log
to our broken method now.
We will place one at
the top that lets
us know when the method
is being invoked,
then another to display the value of
this variable here called Damageable,
as well as one to display
the value of Message.
Finally, one at the end
of the message to let us
know when it's completed
its execution.
Now, we can play the game
until the error appears
again and analyze the logs to
figure out what's going on.
It looks like there's
some edge case that's
causing Damageable to be set to null,
which results in our
Null Reference Exception
when the applied damage
method is invoked.
It's a good place to start,
but we still need more information,
which means we'll need to add
more log statements and
run our game again,
and even that might not be enough.
We might have to complete two
or three more iterations of
this slow trial and error approach
before we fully understand
how to fix this bug,
and that just takes too much time.
Luckily for us, Visual
Studio has a tool
that offers the perfect
solution to this problem.
The debugger in Visual Studio is
a tool that allows us to step through
our code line by line and inspect
the values of our
variables at runtime,
or in other words,
as the code is actively running.
To do that, we'll need
to make sure that
Visual Studio is attached
to the instance of Unity
that's currently running
our project by either
clicking the play button that's
labeled Attach to Unity,
or by locating the Unity
instance manually,
which we can do by expanding
the Debug menu and clicking
"Attach Unity Debugger."
Doing so will open
a small window that
contains a list of all the
available Unity instances,
including remote instances that
are running on your network.
Let's go ahead and click
on "Attach to Unity",
which is a much quicker option.
Now Visual Studio's attached to
the correct instances of Unity,
and we can start
debugging our project by
switching back to Unity
and pressing "Play".
Now we're officially
debugging our project.
But if we want to find out what's
causing our null reference exception,
we'll need to set what's called
a breakpoint in our code,
so let's stop running
our game and switch back
over to Visual Studio.
Breakpoints are a feature of
the debugger that allow you to
pause the execution of your
game on a single line of code.
Once paused, you can
examine variables,
step through the code,
and perform other
similar debugging tasks.
Let's set up a breakpoint at the top
of the SendDamageMessage function.
We can do that by clicking the
gray bar to the left of our code.
Alternatively, we can expand
the Debug menu and click the
"Toggle Breakpoint" button,
which has the keyboard shortcut F9.
Now we're ready to start debugging.
We can do this by switching back to
Unity again and pressing "Play",
or by expanding the play menu
and selecting "Attach
to Unity and Play",
which will play the
open scene and switch
the focus back to Unity
for us automatically.
Now, the key to diagnosing any
problem is to recreate the bug.
But first, it's important to
understand what the
code actually does.
We'll start with the happy path
and shoot an enemy so we can
step through the code and see
the expected behavior play out.
Now that we've shot an enemy,
we can see that the
running scene is paused,
which means that our
breakpoint has been reached.
Over in Visual Studio,
we can see that the first
line is now highlighted,
signifying that the execution
is currently paused there,
and down at the bottom of the screen,
we can also see that
the debug window is
populated with all the variables
that are currently in scope,
including the offending
Damageable variable.
Let's move the execution of
this code one step forward by
pressing the Step Over
button in the toolbar.
Now the execution has
progressed to the next line.
If we look back at the debug menu,
we can see that the
Damageable variable has
now been populated and
is no longer null.
If we set forward again,
this time I'll just
use the shortcut F10,
and one more time, it's clear that
the code is working because
the exception was not thrown.
Now we can go ahead
and recreate the error
by shooting a non-enemy in the scene.
First, let's let the code
go back to executing as
normal by pressing the "Continue"
button in the Toolbar.
Then let's switch back to Unity
and shoot this box in our scene.
Now the scene is paused,
and the Visual Studio debugger has
stopped the execution
of the first line,
so let's step through it
again, and look at that.
In this scenario, the damageable
variable is null because
the game object that was passed
into this function, the box,
did not have the component called
Damageable attached to it,
and when we set to the next line,
we can see that the
exception is thrown,
which, of course,
we'll need to handle.
Thanks to the debugger,
we were able to recreate
the bug and determine
what was causing it.
All we have to do now is add
a simple null-checking
guard clause to
the top of the
SendDamageMessage function.
Then step through the code one
last time and confirm that it works.
Let's go ahead and add our new logic.
The guard clause right after
Damageable is initialized.
If Damageable equals null, return.
Now, with our breakpoint still
in place, let's test it out.
We'll take aim at our box,
and now we can set to the code again.
But this time, our guard
clause will recognize that
Damageable is null and break
out of the function early.
We can quickly confirm this by
hovering over Damageable with
our mouse to reveal the
inline inspection tool tip.
Sure enough, Damageable is null,
so our logic will now
break out of this function
prematurely to avoid
the null reference exception
from being thrown.
Log statements are a quick way to
expose what your code is doing,
but they only offer so much.
The Visual Studio debugger,
on the other hand,
gives you access to all the
information you need to
understand how your
logic is operating,
and the setup and process is similar
across all Visual Studio products.
So whether you're
using Visual Studio,
Visual Studio for Mac,
or Visual Studio Code,
make sure you take advantage
of this powerful tool so you
can debug issues more
effectively and fix bugs faster.
[MUSIC]
