Quantcast
Channel: Visual Studio Blog
Viewing all 1039 articles
Browse latest View live

Break When Value Changes: Data Breakpoints for .NET Core in Visual Studio 2019

$
0
0

“Why is this value changing unexpectedly and where or when is this occurring?!

This is a question many of us dread asking ourselves, knowing that we’ll have to do some tedious trial-and-error debugging  to locate the source of this issue.  For C++ developers, the exclusive solution to this problem has been the data breakpoint, a debugging tool allowing you to break when a specific object’s property changes.  Fortunately, data breakpoints are no longer a C++ exclusive because they are now available for .NET Core (3.0 or higher) in Visual Studio 2019 Preview 2!

Data breakpoints for managed code were a long-requested ask for many of you. They are a great alternative to simply placing a breakpoint on a property’s setter because a data breakpoint focuses on a specific object’s property even when it’s out of scope, whereas the former option may result in constant, irrelevant breaks if you have hundreds of objects calling that function.

How do I set a data breakpoint?

Setting a data breakpoint is as easy as right-clicking on the property you’re interested in watching inside the watch, autos, or locals window and selecting “Break when value changes” in the context menu.  All data breakpoints are displayed in the Breakpoints window. They are also represented by the standard, red breakpoint circle next to the specified property.

Setting a data breakpoint in the Locals window and viewing the breakpoint in the Breakpoints window

When can I use data breakpoints?

Now that you know how to set a data breakpoint, now what?  Here are some ways to take advantage of data breakpoints when debugging your .NET Core applications.

Let’s say that you want to figure out who is modifying a property in an object and for most of the time, this property change does not happen in the same file. By setting a data breakpoint on the property of interest and continuing, the data breakpoint will stop at the line after the property has been modified.

Break when _data value changes

This also works for objects. The data breakpoint will stop when the property referencing the object changes value, not when the contents of the object change.

Break when the property referencing an object changes

As illustrated in the GIF above, calling the toEdit._artist.ChangeName() function did not cause a breakpoint to hit since it was modifying a property (Name) inside the Song’s Artist property.  In contrast, the data breakpoint is hit when the _artist property is assigned a reference to a new object.

Data breakpoints are also useful when you want to know when something is added or removed from a collection. Setting a data breakpoint on the ‘Count’ field of classes from System.Collections.Generic makes it easy to detect when the collection has changed.

Break when an object is added or removed from a list

Are there opportunities for improving managed data breakpoints?

Since Visual Studio 2019 is still in preview, we highly encourage you to experiment, play around with, and provide feedback for this iteration of data breakpoints.  Here are some known scenarios where data breakpoints currently cannot be set that we are working on erasing and improving in future Visual Studio updates:

  • Properties that are not expandable in the tooltip, Locals, Autos, or Watch window
  • Static variables
  • Classes with the DebuggerTypeProxy Attribute
  • Fields inside of structs

Managed data breakpoints also exclude properties that call native code and properties that depend on too many fields.

Ready to try data breakpoints in your .NET Core applications?  Let us know in the comments!

For any issues or suggestions about this feature, please let us know via Help > Send Feedback > Report a Problem in the IDE or in the Developer Community.

Leslie Richardson, Program Manager, Visual Studio Debugging & Diagnostics
@lyrichardson01

Leslie is a Program Manager on the Visual Studio Debugging and Diagnostics team, focusing primarily on improving the overall debugging experience and feature set.


Code more, scroll less with Visual Studio IntelliCode

$
0
0

You may know that Visual Studio IntelliCode helps you write code from commonly used libraries, based on machine learning across thousands of open sourced GitHub repos. Instead of having to search and scroll through a sorted list of methods and properties, you get suggestions on the most likely ones for your coding context as you type.

While the wisdom of the open source community is delivered direct to your editor’s IntelliSense, what if you want to write code based on a set of APIs not included in the GitHub public repos? Perhaps you use numerous internal utility and base class libraries, or domain-specific libraries that aren’t often used in open-source.  You may not know that if you code in C# you can have IntelliCode analyze to your own code and share what it learns it across your team, so you can all benefit from recommendations and more easily collaborate. Depending on your codebase, analyzing your code and sharing the resulting model could be done in a matter of minutes and save your team hours of hunting through lists and documentation diving.

How do I create and use my own model?

It’s as easy as 3 short steps.

  1. Make sure you have the IntelliCode extension for Visual Studio installed
  2. Effortlessly create a custom model for a codebase that contains good examples of usage of your desired class libraries – remember that the quality of suggestions offered by IntelliCode is directly related to the quality of the samples you provide.
  3. Easily share it with your colleagues so they can start using the recommendations. If you need to update the model, for instance if there are substantial changes to the code, your team will automatically receive the latest updates when you retrain.

Creating an IntelliCode Custom Model

My colleague Allison Buchholtz-Au has a great video covering this topic if you’d like to see more details.

If you’re a contributing author of an open source component, it’s simple for you to share a model that helps your users leverage your libraries more easily. Don’t forget to share the model somewhere that users who are getting started will find it. We suggest linking to it from the README in your repo.

What about security?

Most importantly, we don’t upload your raw source code to our servers. You can learn more about what happens when you train a model in our FAQ.

Your feedback matters

If you have more suggestions and feedback about IntelliCode, we’d love to hear from you. Get in touch and let us know more.

The post Code more, scroll less with Visual Studio IntelliCode appeared first on The Visual Studio Blog.

Visual Studio 2019 Launch Event agenda and speakers now published

$
0
0

We’re only 15 days away from the general availability of Visual Studio 2019 and our virtual Visual Studio 2019 Launch Event. It’s been incredible to see all the buzz and excitement in the community around the launch, from the 180+ local launch events happening all across the globe over the next months to all the posts about the features you’re most excited about on Twitter. Today, I’m happy to share the full agenda for the Visual Studio 2019 Launch Event with you, alongside the list of speakers.

Pacific Daylight Time ‎(UTC-7)‎ Coordinated Universal Time ‎(UTC)‎ Session Speaker(s)
9:00 AM 16:00 Not your average keynote Scott Hanselman & friends
10:00 AM 17:00 Live Q&A with Visual Studio Big Wigs Amanda Silver & Joseph Hill
10:30 AM 17:30 Write beautiful code, faster Kendra Havens
11:00 AM 18:00 Streamline your dream dev team Allison Buchholtz-Au & Jon Chu
11:30 AM 18:30 Squash bugs and improve code quality Leslie Richardson
12:00 PM 19:00 Taking DevOps to the next level with GitHub and Azure DevOps Steven Borg & Stanley Goldman
12:30 PM 19:30 AI-infused break Seth Juarez
1:00 PM 20:00 Accelerate your C++ development Erika Sweet & Marian Luparu
1:30 PM 20:30 Cross-platform mobile apps made easy using Xamarin James Montemagno
2:00 PM 21:00 To the cloud with Visual Studio and Azure Andrew Hall & Paul Yuknewicz
2:30 PM 21:30 Build amazing web apps with .NET Core Dan Roth
3:00 PM 22:00 A tour of Visual Studio for Mac for .NET development Mikayla Hutchinson
3:30 PM 22:30 Amazing devs doing amazing things Jeff Fritz, Ginny Caughey (MVP), & Oren Novotny (MVP)
4:00 PM 23:00 #CodeParty Virtual Attendee Party, live on Twitch

As you can see, we have a day packed with exciting demos and conversations with the incredible people behind the products in store. Be sure to stick around for the #CodeParty Virtual Attendee Party closing out the day on twitch.tv/visualstudio, sponsored by our amazing Visual Studio partners. There will be plenty of opportunities to talk to our team, hang out, and of course win some awesome prizes. Check out the full list of partners behind the party on the launch event website.

Be a part of the launch celebration

Of course, it wouldn’t be much of a celebration if we’re the only ones celebrating. We’re hoping you’ll join in on the launch, here’s how you can participate:

  • #VS2019 on Twitter
    • Let us know what your favorite feature of Visual Studio 2019 is and what you’re most excited about
    • If you spot some of the hidden gems and Easter eggs we sprinkled throughout the keynote, show off your eye for detail online
    • During the sessions between 10 AM and 4 PM (Pacific Time) ask questions and we’ll do our best to get them in front of the speakers to be answered live
  • twitch.tv/visualstudio
    • We’ll be streaming on Twitch all day (alongside YouTube and Channel 9) and we’ll have team members online to chat with and answer your questions
    • The #CodeParty at the tail-end of the launch event will be exclusively on Twitch, where you can hang out, chat with the people behind the products, and win prizes
  • Local launch events
    • There are over 180 local launch events happening across the globe between April 2nd and June 30th. Even if you can’t tune in live on April 2nd, these community-driven events will offer plenty of opportunities to learn and connect

 

Thank you for your enthusiasm about the launch so far and we hope to see you on April 2nd!

The post Visual Studio 2019 Launch Event agenda and speakers now published appeared first on The Visual Studio Blog.

Visual Studio Subscriptions – everything you need for Azure development

$
0
0

Recently, our product team has been talking with Visual Studio subscribers to learn more about how they approach cloud development. Many of the subscribers we spoke with mentioned that they were unaware of the benefits included with a Visual Studio subscription, that are intended to make learning new technologies and prototyping easy.

If you’re interested in cloud development, or simply want to learn more about new development tools, techniques, and frameworks, your subscription includes a wide range of benefits you can use. The level of these benefits you have depends on your subscription type. Check out this benefits video or read on below for an overview.

Cloud services

Subscribers have access to unlimited Azure DevOps accounts and access to features on any Azure DevOps organization to share code, track work, and ship software. You can use Azure Pipelines to run Continuous Integration and Continuous Delivery jobs and automate the compilation, testing and deployment of applications, for all languages, platforms and cloud services. You also get access to Azure Boards, which lets you deliver software faster thanks to proven agile tools for planning, tracking and discussing work items across teams.

Your subscription has a $50-$150 monthly Azure credit, which is ideal for experimenting with and learning about Azure services—your own personal sandbox for dev/test. When you activate this benefit, a separate Azure subscription is created with a monthly credit balance that renews each month while you remain an active Visual Studio subscriber. If the credits run out before the end of the month, the Azure services are suspended until more credits are available. No surprises, no cost, no credit card required. If you wonder what you can buy with a $50 credit, check out this blog post for some ideas.

If you’d like to collaborate with your team in the cloud, the Azure Dev/Test offer enables you to quickly get up and running with dev/test environments in the cloud using exclusive pre-configured virtual machines and up to a 50% discount on a range of services. You have the flexibility to create multiple Azure subscriptions based on this offer, enabling you to maintain isolated environments and a separate bill for different projects or teams.

Visual Studio Enterprise subscriptions include Enterprise Mobility + Security to help you secure and manage identities, devices, apps and data.

Developer tools

Subscribers have continued access to the latest versions of Visual Studio IDE on Windows & Mac.

Cloud migration tools such as CAST Highlight by CAST (Enterprise only) and CloudPilot by UnifyCloud were recently added as new benefits to help you get a head start on your app modernization journey and migration to the cloud.

Training and support

Take your skills to the next level with LinkedIn Learning and Pluralsight courses included in your subscriber benefits.

Your subscription also provides access to technical experts, Azure Advisory Chat, and Azure Community to help you solve issues and answer questions. Just submit a technical support ticket, questions via chat, or start community discussions.

You can find all these benefits by logging into the subscriber portal at https://my.visualstudio.com. Contact your admin for access to the portal if you do not have a currently assigned subscription. For more information on how to use your benefits, check out our docs.

We would love to hear your feedback, suggestions, thoughts, and ideas in the comments below.

The post Visual Studio Subscriptions – everything you need for Azure development appeared first on The Visual Studio Blog.

Using Newtonsoft.Json in a Visual Studio extension

$
0
0

The ever popular Newtonsoft.Json NuGet package by James Newton-King is used throughout Visual Studio’s code base. Visual Studio 2015 (14.0) was the first version to ship with it. Later updates to Visual Studio also updated its Newtonsoft.Json version when an internal feature needed it. Today it is an integral part of Visual Studio and you can consider it a part of the SDK alongside other Visual Studio assemblies.

Extensions can therefore also use the very same Newtonsoft.Json shipped with Visual Studio. It can, however, be confusing to know what version to reference and whether to ship the Newtonsoft.Json.dll file itself with the extension or not. And what if the extension supports older version of Visual Studio that doesn’t come with Newtonsoft.Json?

I promise it’s not confusing once you know how, so let’s start at the beginning with versioning.

Versioning

Just like any other Visual Studio SDK assemblies, extensions must reference lowest version matching the lower bound of supported Visual Studio versions. For instance, if the extension supports Visual Studio 14.0, 15.0, and 16.0, then it must reference the 14.0 SDK assemblies. The same is true for referencing Newtonsoft.Json, but it is less obvious to know what version shipped when.

Here’s the breakdown:

  • Visual Studio 16.0 – Newtonsoft.Json 9.0.1
  • Visual Studio 15.3 – Newtonsoft.Json 9.0.1
  • Visual Studio 15.0 – Newtonsoft.Json 8.0.3
  • Visual Studio 14.0 – Newtonsoft.Json 6.0.x
  • Visual Studio 12.0 – none

So, if your extension’s lowest supported Visual Studio version is 14.0, then you must reference Newtonsoft.Json version 6.0.x. In fact, make sure the entire dependency tree of your references doesn’t exceed that version.

Learn more about Visual Studio versioning in the blog post Visual Studio extensions and version ranges demystified.

Binding redirects

When referencing a lower version of Newtonsoft.Json than ships in Visual Studio, a binding redirect is in place to automatically change the reference to the later version at runtime. Here’s what that looks like in the devenv.exe.config file of Visual Studio 15.0:

<dependentAssembly>
  <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral"/>
  <bindingRedirect oldVersion="4.5.0.0-8.0.0.0" newVersion="8.0.0.0"/>
</dependentAssembly>

It makes sure that when an assembly references a version of Newtonsoft.Json that is older than 8.0.0.0, it automatically redirects to use the 8.0.0.0 version that ships in Visual Studio 15.0.

This is the same mechanism that makes it possible to use an SDK assembly such as Microsoft.VisualStudio.Language.Intellisense version 12.0 in Visual Studio 16.0. A binding redirect automatically changes the reference to the 16.0 version of that assembly.

Don’t ship it unless you need to

The rule of thumb is to not ship the Newtonsoft.Json.dll file in the .vsix container. Since Visual Studio always have a copy and does binding redirects, there is no reason to ship it.

However, there are two scenarios where you do want to ship the .dll with the extension.

  1. If your extension supports Visual Studio 12.0 or older
  2. If you absolutely need a newer version than shipped by Visual Studio

When supporting Visual Studio 12.0 or older, try to use Newtonsoft.Json version 6.0.x if possible. That ensures that when the extension runs in Visual Studio 14.0 and newer, then the .NET Framework won’t load the assembly from your extension, but instead use the one it ships with. That means fewer assemblies needed loading by the CLR.

If you ship your own version, then don’t expect to be able to exchange Newtonsoft.Json types with other assemblies in Visual Studio because they were compiled against a different version. Normally binding redirects unifies the versions, but not when shipping your own. Also specify a code base for it so Visual Studio can resolve it at runtime. You don’t always need to, but it’s considered best practice and avoids any issues. Simply add this line to your AssemblyInfo.cs file:

[assembly: ProvideCodeBase(AssemblyName = "Newtonsoft.Json")]

It’s very important that you never add your own binding redirect for Newtonsoft.Json.dll either. Doing so will force all assemblies in the Visual Studio process to redirect to the version you ship. This might lead to unpredictable issues that could end up breaking other extensions and internal components.

Follow the simple rules

So, the simple rules to apply when using Newtonsoft.Json are:

  1. Reference the lowest version of Newtonsoft.Json (but no lower than 6.0.x)
  2. Don’t ship Newtonsoft.Json.dll in the extension
    1. Except if you target Visual Studio 12.0 or older
    2. Except if you absolutely need a newer version than ships in Visual Studio
    3. If you do, specify a code base for it
  3. Don’t ever add binding redirects for Newtonsoft.Json.dll

I wrote this post based on feedback and questions about how to correctly reference Newtonsoft.Json from an extension. I hope it helped clarify it. If not, please let me know in the comments.

The post Using Newtonsoft.Json in a Visual Studio extension appeared first on The Visual Studio Blog.

Visual Studio Extensibility Day at Build 2019

$
0
0

Please join us for a day full of Visual Studio extensibility deep dives, geek-outs, and networking on Friday, May 10th, 2019 at the Microsoft campus in Redmond. Our agenda is intended for existing and new Visual Studio IDE (not Visual Studio Code) extension authors and partners and will be highly technical in nature.

The Extensibility Day will take place in Microsoft building 18 which is the home of the Visual Studio engineering team. This means that we will have Visual Studio engineers directly on hand throughout the day for your questions and troubleshooting.

You’ll learn about what’s new in Visual Studio 2019 for extensibility, get an update from the Marketplace and see what’s on the roadmap. On top of that, there will be technical deep dives that explore the inner workings of it all. Sprinkle on some networking, Q&A, swag, and surprises and you’ll end up with a great day of learning and fun. The event ends in the afternoon with an opportunity to unwind with your fellow extenders at the Microsoft Commons in the heart of the Redmond Campus.

Should I go?

If you have written a Visual Studio IDE extension or have been a Visual Studio partner, then we would encourage you to attend. There is a lot of content, networking opportunities and you have a venue to interact with the Visual Studio engineers and help shape future work too!

The event will not contain any introductory sessions and will assume that you are familiar with the Visual Studio extensibility model.

Register

Registration is now open and operates under a first-come first-serve basis. We have limited availability so make sure to register as soon as possible.

The post Visual Studio Extensibility Day at Build 2019 appeared first on The Visual Studio Blog.

Visual Studio 2019: Code faster. Work smarter. Create the future.

$
0
0

Visual Studio 2019 is generally available today and available for download. With Visual Studio 2019, you and your teams will become more productive in building current and future projects as you benefit from the innovation in the IDE that makes every keystroke count.

As we’ve shared earlier, Visual Studio 2019 improves on Visual Studio 2017 in a few areas. It helps you get into your code more quickly by making it simpler to clone a Git repo or to open an existing project or folder. It also introduces improvements to the template selection screen to make it easier to start a new project. While you’re coding, you’ll notice that Visual Studio 2019 improves code navigation and adds many refactorings, as well as a document health indicator and one-click code clean-up to apply multiple refactoring rules. There are also improvements to the debugging experience, including data breakpoints for .NET Core apps that help you break only on value changes you’re looking for. It also includes get AI-assisted code completion with Visual Studio IntelliCode.

These capabilities work with both your existing project and new projects – from cross-platform C++ applications, to .NET mobile apps for Android and iOS written using Xamarin, to cloud-native applications using Azure services. The goal with Visual Studio 2019 is to support these projects from development, through testing, debugging, and even deployment, all while minimizing the need for you to switch between different applications, portals, and websites.

Check out the launch event

Be sure to tune in to the Visual Studio 2019 Launch Event today at launch.visualstudio.com, or watch it on-demand later, where we’ll go into a lot more depth on these features and many others. During the launch event, we’ll discuss and demo Visual Studio 2019. We’ll also share content on Visual Studio 2019 for Mac and Visual Studio Live Share, both of which are also releasing today. There are also almost 70 local launch events around the world you can join today and over 200 between now and end of June. Thank you for your enthusiasm about our best release yet.

To help kick-start your experience with Visual Studio 2019, we’ve partnered with Pluralsight and LinkedIn Learning to bring you new training content. Pluralsight has a new, free, Visual Studio 2019 course (available until April 22, 2019). A path and skill assessment are also available, so you can dive right in. On LinkedIn Learning you’ll find a new course (free until May 2nd) covering the highlights in Visual Studio 2019. Of course, you can always head over to VisualStudio.com and our docs to find out what’s new, or dig into the release notes for all the details.

Thank you for your ongoing feedback

We could not have made this happen without you. Ever since we released Preview 1 of Visual Studio 2019 in December, we’ve received an incredible amount of feedback from you, both on what you like and what you want to see improved. As always, you can continue to use the Report a Problem tool in Visual Studio or head over to the Visual Studio Developer Community to track your issue or suggest a feature. We’ve made many tweaks and improvements along the way to address your feedback, rest assured that we will continue doing so in minor releases going forward.

We want to sincerely thank you for taking the time to provide the feedback that we use to shape Visual Studio 2019 into the best developer environment for you. We can’t wait to see what you’ll create with Visual Studio 2019.

The post Visual Studio 2019: Code faster. Work smarter. Create the future. appeared first on The Visual Studio Blog.

Live Share now included with Visual Studio 2019

$
0
0

We’re excited to announce the general availability of Visual Studio Live Share, and that it is now included with Visual Studio 2019! In the year since Live Share began its public preview, we’ve been working to enhance the many ways you collaborate with your team. This release is the culmination of that work, and all the things we’ve learned from you along the way.

If you haven’t heard of Live Share, it’s a tool that enables real-time collaborative development with your teammates from the comfort of your own tools. You’re able to share your code, and collaboratively edit and debug, without needing to clone repos or set up environments. It’s easy to get started with Live Share.

Thanks for all your feedback!

We’ve been thrilled with all the great feedback and discussions we’ve had. Your input has helped guide Live Share’s development and enabled us to focus in on the areas of collaboration most important to you. Based on your feedback, we added features like read-only mode, support for additional languages like C++ and Python, and enabled guests to start debugging sessions.

/var/folders/78/t4msz04s0lg7jvy0w9lv_nwc0000gn/T/com.microsoft.Word/WebArchiveCopyPasteTempFiles/sidebyside1.png

Additionally, we’ve learned so much about how your teams collaborate, and how Live Share is applicable in a wide variety of use cases. Live Share can be used while pair programming, conducting code reviews, giving lectures and presenting to students and colleagues, or even mob programming during hackathons. Live Share complements the many diverse ways you work – whether it be together while co-located in the same office, remotely from home, or in different countries on opposite sides of the world.

3rd Party Extensions

Live Share is all about sharing the full context of your project. It’s not just the code in Visual Studio, but also the extensions you use. Along with this release, we’re excited to have partnered with a few 3rd party extensions to enhance the Live Share experience in Visual Studio.

OzCode enhances your C# debugging experience by offering a suite of visualizations, like datatips to see how items are passed through a LINQ query, and heads-up display to see how a set of boolean expressions evaluates. During a Live Share session, guests can now leverage time-travel debugging as well.

CodeStream enables you to create discussions about your codebase to help build knowledge with your teammates. One of the biggest feature requests we’ve received has been to include integrated chat, and with CodeStream, you get a companion chat experience within a Live Share session.

Collaborate Today

We’re continuing to build and improve Live Share! We have so much more collaboration goodness to share. We’ve received such great feedback and would love to continue to hear more from you. Feel free to let us know what you’d like to see next with Live Share by filing issues and feature requests or by responding to our feedback survey.

With Live Share installed by default in Visual Studio 2019, it’s easy to get started collaborating with your team. For more information about using Live Share, please check out our docs!

The post Live Share now included with Visual Studio 2019 appeared first on The Visual Studio Blog.


Visual Studio 2019 for Mac is now available

$
0
0

Today, we are excited to announce the general availability of Visual Studio 2019 for Mac – the next major version of our .NET IDE on the Mac. This release is now available as an update in the Stable channel for existing Visual Studio for Mac users, and new users can download and install it today as well. You also can learn more about the new capabilities in this version by reading our release notes.

Visual Studio 2019 for Mac focuses on improving the core of the IDE, setting a foundation for us to bring new capabilities to you more rapidly with future updates. In this blog post, we want to highlight some of the new capabilities included with this release which have been shaped greatly by your feedback. Thank you! In addition to general improvements to the IDE, we have also introduced several improvements for developers building mobile apps using Xamarin, games using Unity, and web applications and services using .NET Core. So, let’s get started!

A new C# editor

The code editor in Visual studio for Mac has been completely replaced with a new editor built on a shared core with Visual Studio on Windows, and with native macOS UI. Not only does this provide an enhanced experience with smooth editing and navigation, but the new editor also has all the powerful IntelliSense/code-completion and quick fix suggestions you expect from a Visual Studio editor. Furthermore, we have added support for bi-directional text, multi-caret, word wrapping and much more that you can read about in greater detail here.

We are busy adding a last few finishing touches to the editor and hence the preview editor is only available for use when you opt-in. To enable the new editor, navigate to the Visual Studio > Preferences… menu, Text Editor > General section and check the Open C# files in the New Editor checkbox. Stay tuned as we work towards enabling it for C# and XAML, with other languages coming shortly thereafter.

Visual Studio for Mac 2019 - editor

Start window

With Visual Studio 2019 for Mac, we’ve introduced a brand-new way of interacting with your projects and getting you where you need to go in the IDE. The Start Window allows you to quickly create new projects or conveniently search and navigate to a project you might have previously opened in the IDE.

start screen Visual Studio for Mac

Running multiple instances

Visual Studio 2019 for Mac allows you to easily launch multiple instances of the IDE from the macOS dock, enabling you to work on multiple solutions simultaneously, one per instance.

Multiple VS4Mac instances

Xamarin tools

Developers run though the “build, deploy, debug” cycle countless times in any given day. As we continue working to shorten the inner development loop, we’ve made big gains in trimming down the time you spend building and deploying for Android, so you can focus on creating amazing mobile apps. Say goodbye to all those build-time coffee breaks!

With the help of your feedback, we found that optimizing incremental builds and deployments is one great way to achieve a high-impact improvement. Testing with the SmartHotel360 app showed an almost 30% decrease in incremental build times, while deployment times are over twice as fast:

Step Visual Studio 2017 Visual Studio 2019 Delta
First build 01:04.20 00:50.13 -21.95%
Incremental Build (XAML Change) 00:10.62 00:07.47 -29.66%
Deploy (XAML Change) 00:09.03 00:04.44 -50.83%

 

A full report of build performance profiling, as well as methodology, can be viewed on the Xamarin.Android wiki.

Tools for Unity

We have ported the Unity debugger from Visual Studio on Windows to the Mac. Beyond making it possible for us to apply fixes across both products at the same time, this new debugger provides better compatibility with older versions of Unity and a better experience when debugging unsafe C# code.

ASP.NET Core and .NET Core tools

We have made many improvements to our .NET Core and web tools including better support for JavaScript colorization within Razor (.cshtml) files, auto-updating of Azure functions, the ability to easily set up multiple startup projects for debugging and, finally, updated Docker tools.

Performance, reliability and accessibility improvements

We have made a significant number of performance and reliability improvements in this release across the board. In particular, the C# code editor, Git support, Xamarin, and.NET Core debugging should all be significantly faster and more reliable with this release. This release also includes more than 200 accessibility related fixes that move us closer to our goal to be completely accessible on the Mac.

What’s next for Visual Studio 2019 for Mac

As we had previously called out in our roadmap, our near-term priority is to enable the new editor for C#, followed by other file extensions. Beyond that, we are bringing over the Xamarin Forms XAML language service from Visual Studio on Windows to the Mac, adding support for multi-targeting, solution level package management and file-nesting support for ASP.NET Core. Stay tuned for future Visual Studio 2019 for Mac updates!

We strive to be 100% driven by your feedback and we love to hear from you, so please do share your feedback and suggestions. Thank you for helping us shape Visual Studio for Mac. We look forward to you downloading and using this new release.

 

The post Visual Studio 2019 for Mac is now available appeared first on The Visual Studio Blog.

Introducing Time Travel Debugging for Visual Studio Enterprise 2019

$
0
0

The Time Travel Debugging (TTD) preview in Visual Studio Enterprise 2019 provides the ability to record a Web app running on a Azure Virtual Machine (VM) and then accurately reconstruct and replay the execution path. TTD integrates with our Snapshot Debugger offering and allows you to rewind and replay each line of code however many times you want, helping you isolate and identify problems that might only occur in production environments.

The most effective type of debugging often occurs in what we call the “inner loop”. While you’re in the act of reviewing and debugging code locally, before you’ve pushed to version control. The problems we encounter during inner loop development are usually easier to understand and diagnose because they are accessible and repeatable.

Today, we’re excited to announce the release of the Time Travel Debugging (TTD) in Visual Studio Enterprise. With TTD, we are giving you the power to record code executed in production and replay the execution path inside Visual Studio. TTD also gives you the ability to move forward and backwards in time as if you were performing “inner loop” debugging locally. You also get access to important debugging features like locals and the call stack.

Today’s debuggers typically allow you to stop at a specific breakpoint by halting the entire process and then only move forward. Even with a more advanced debugging tool like IntelliTrace, you record events and data at discrete moments in time. TTD has a significant advantage over snapshots, logging or crash dump files, as these methods are generally missing the exact details of the execution path that led up to the final failure or bug.

What is the Time Travel Debugging?

Time Travel Debugging (TTD) is a reverse debugging solution that allows you to record the execution of code in an app or process and replay it both forwards and backwards. TTD improves debugging since you can go back in time to better understand the conditions that lead up to a specific bug. Additionally, you can replay it multiple times to understand how best to fix the problem. TTD technology was recently introduced in a preview version of WinDbg for native code scenarios.

We have extended the Snapshot Debugger with TTD to allow you to record your applications as it executes. That recording can then be played back in Visual Studio 2019 Enterprise where you can rewind and replay each line of code as many times as you want. TTD records on the thread that matches the snappoint conditions and will generally run until the end of the method. If there is an “await” after the snappoint but before the end of the method, we will stop recording where the await occurs. This feature will be in preview for the release of Visual Studio 2019 with a go live license. We plan to add more TTD scenarios in future updates.

Getting started with TTD

The Time Travel Debugging preview can be enabled in the latest version of Visual Studio Enterprise 2019 for Azure Virtual Machines on the Windows OS running ASP.NET (4.8+).

After installing the latest version of Visual Studio Enterprise, complete the following steps:

1. Open the project you would like to Time Travel Debug – ensure that you have the same version of source code that is published to your Azure Virtual Machine.

2. Choose Debug > Attach Snapshot Debugger and select the Azure Virtual Machine your project is deployed to along with an Azure storage account. You will be required to install the Snapshot Debugger site extension the first time an attach is attempted.

3. Select the Time Travel Debugging option and then click Attach. Once Visual Studio is in Snapshot Debugger mode it will be capable of recording using TTD.

4. Create a snappoint and configure it to enable time travel debugging. Click Start\Update Collection.

5. Once your Snapshot has been collected click on View Snapshot and you can use the command bar to step forwards and backwards within the recorded method.

TTD preview limitations

During the initial preview stage of TTD we will be supporting AMD64 Web apps running on a Azure Virtual Machine (VM). We expect that recording will add significant overhead to your running process, slowing it down based on process size and the number of active threads. We also anticipate a degraded debugging experiences in some of the following scenarios: –

  • During a GC compacting phase.
  • Stepping through an optimized method e.g. when you step into a method that does not contain a snappoint.
  • If your application internally loads or unloads app domains.
  • Recording only occurs on the thread that was triggered by the snappoint, code that subsequently impacts alternate threads will also be degraded.

Please Note: we will also not record the async causality chains.

During preview testing we found that the TTD file sizes ranged from several hundred megabytes up to several gigabytes depending on how long your session lasts and how long the web app runs. However, files created by TTD will be cleaned up once the Snapshot Debugger session ends, and an app pool recycle is initiated. For our preview release we also recommend using a VM with a minimum of 8GB RAM.

Try out TTD now!

We are incredibly excited about how this preview feature can help enhance your debugging experiences in Azure, but this is just the beginning. Our team continues to design and build additional TTD capabilities that we plan to add in upcoming Visual Studio releases.

We are counting on your feedback via our Developer Community and the Feedback Hub, you can help us prioritize what improvements to make because we genuinely value all the responses you provide.

The post Introducing Time Travel Debugging for Visual Studio Enterprise 2019 appeared first on The Visual Studio Blog.

Little great things about Visual Studio 2019

$
0
0

A few days ago, we announced the general availability of Visual Studio 2019. But I’ve been using Visual Studio 2019 exclusively since the first internal build – long before the release of Preview 1 in December of 2018. During this time, there has been a lot of little features that have put a smile on my face and made me more productive.

I want to share a few of them with you since they are not all obvious and some require you to change some settings. Let’s dive in.

Clean solution load

When a solution is closed, its state is saved so that next time you open it, Visual Studio can restore the collapsed/expanded state of projects and folders in Solution Explorer and reopen the documents that were left open. That’s great but I prefer a clean slate when I open solutions – no files open and all the tree nodes collapsed in Solution Explorer.

I wrote the Clean Solution extension to provide this behavior in previous version of Visual Studio. This feature is now native to Visual Studio 2019 and can be enabled with two separate checkboxes. Go to search (Ctrl+Q) and type in “load” to find the Projects and Solutions > General options page.

Uncheck both the Reopen documents on solution load and Restore Solution Explorer project hierarchy on solution load checkboxes.

An added benefit from unchecking these two checkboxes is that solutions will load faster too, because of the eliminated overhead from restoring state. Win-win.

Git pull from shortcut

I do a lot of work with GitHub repos and I often take pull requests from people. That means I must make sure to do a git pull before I make any subsequent commits. But, as it turns out repeatedly, this is something I tend to forget. The result is that I end up with merge conflicts and other nuisances.

The only way to do git pull in the past was to either use Team Explorer, the command line, or an external tool. What I really wanted was a keyboard shortcut from within Visual Studio that did it for me.

Previously, Team Explorer’s pull command was not a command you could assign keyboard shortcuts to but now it is. Go to search (Ctrl+Q) and type “keyboard” to find the Environment > Keyboard options page. From there, find the Team.Git.Pull command from the list. Then assign any shortcut to it and hit the OK button. I chose to use Ctrl+Shift+P.

To automatically perform a git pull upon solution load, try out the free Git Pull extension.

Code Cleanup for C#

Keeping source code neatly formatted and ensuring coding styles are consistent is something I’ve never been good at. The new Code Cleanup feature is a huge help in keeping my code neat and tidy since I have configured it to run all the fixers by default.

To do that, go to the Code Cleanup menu sitting in the bottom margin of the editor window and click Configure Code Cleanup.

In the dialog, select all the fixers one by one from the bottom pane and hit the up-arrow button to move them up into the top. Then hit OK.

Now all fixers will run every time you perform a Code Cleanup. Simply hit Ctrl+K, Ctrl+E to execute. The result is a nicely formatted document with a bunch of coding style rules applied, such as added missing braces and modifiers. Voila!

IntelliCode

IntelliCode is a new feature that augments the IntelliSense completions based on the context you’re in using advanced machine learning algorithms. That proves useful for many scenarios including when you are exploring new interfaces or APIs. I write a lot of Visual Studio extensions and the API surface is so big that there are parts of it I have never used. When I’m exploring a new part of the Visual Studio API, I find it very helpful to have IntelliCode guide me through how to use it.

To enable this powerful feature, you can download IntelliCode from the Visual Studio Marketplace and install the extension.

IntelliCode works for C#, C++ and XAML.

See content of Clipboard Ring

Every time you copy (Ctrl+C) something in Visual Studio, it is being stored in the Clipboard Ring. Hitting Ctrl+Shift+V allows you to cycle through the items in the Clipboard ring and paste the item you select. I find it very useful to keep multiple things in the clipboard at once and then paste the various items to specific locations.

In Visual Studio 2019, the Clipboard Ring now shows a visual preview of its content when hitting Ctrl+Shift+V. That makes it easier than ever to navigate through the copy history and select the right item to paste.

New C# Refactorings

There are lots of new and highly useful refactorings in C# that I’ve come to depend on every single day. They show up as suggestions in the light bulb and include moving members to interface or base class, adjusting namespaces to match folder structure, convert foreach-loops to Linq queries, and a lot more.

To learn more about the new refactorings and other C# features in Visual Studio 2019, check out this post on the .NET blog.

Git Stash

Having the ability to stash away some work for future use is super helpful. Git Stash is what gives me that ability without having to create a new branch. If you’re familiar with TFS, you can think of Git Stash as a shelveset.

The best part is that I can manage all my stashes inside the Team Explorer window. They are easy to create and apply, and I’ve been using them a lot more after Visual Studio now natively supports them.

Try Visual Studio 2019

These were just a few of the many small improvements found throughout Visual Studio 2019 that I find particularly useful. Please share any tips or improvements you’ve found helpful in the comments below!

The post Little great things about Visual Studio 2019 appeared first on The Visual Studio Blog.

Build Visual Studio extensions using Visual Studio extensions

$
0
0

What if the community of extension authors banded together to add powerful features to Visual Studio that made it easier to create extensions? What if those features could be delivered in individually released extensions, but joined by a single installation experience that allows the user to choose which of the features to install? That’s the idea behind Extensibility Essentials – an extension pack that ships community-recommended extensions for extension authors.

Extension authors are usually interested in improving their own tooling in Visual Studio – either by installing extensions created by others or by building some themselves. By banding together, we can create the best and most comprehensive tooling experience for extension authoring. So, let’s test that theory by creating a range of extensions published to the Marketplace under our own accounts, and reference them in Extensibility Essentials to provide a unified and simple installation experience.

The individual extensions can and probably should be single purpose in nature. This prevents feature-creep where additional features are added that may or may not be useful for extension authors. If additional features are not closely related to the extension, then simply create a new extension for them. That way it is up to the individual extension author to decide if they wish to install it. It is also crucial that the extensions follow all the best practices.

Once the individual extension is stable, it can be added to Extensibility Essentials.

The extension pack Extensibility Essentials doesn’t do anything by itself. It is a barebone extension pack that just references the individual extensions. When installing the extension pack, the user can choose which of the referenced extensions to install. At the time of this writing, there are 9 individual extensions.

How the individual extensions are listed before installing

Ideas for new extensions can be centralized to the GitHub issue tracker. By collecting ideas in a central location, it provides a single location to comment on and potentially design features ahead of implementation.

The issue tracker is for both bugs and suggested features

It would be cool if…

So next time you’re sitting in Visual Studio working on an extension, think about what feature you’d like that would make you more productive. If you can’t think of a feature, but feel there is a scenario that is particularly problematic, then open a bug on the GitHub issue tracker and let other people try to figure out how an extension could perhaps solve the issue.

Thinking “it would be cool if…” is the first step to make it possible and with the Extensibility Essentials, it might be closer to becoming reality than imagined.

Does this idea resonate with you? Let me know in the comments.

Mads Kristensen, Senior Program Manager
@mkristensen

Mads Kristensen is a senior program manager on the Visual Studio Extensibility team. He is passionate about extension authoring, and over the years, he’s written some of the most popular ones with millions of downloads.

Q# – a Wish List for the New Year

$
0
0

In previous blog posts you have read about some of the ideas behind Q#, how it came into existence, and its development over the past year. You have read about quantum computing, quantum algorithms and what you can do with Q# today. With the end of the year approaching, there is only one more thing to cover: What is next?

This blog post is about our aspirations for the future and how you can help to accomplish them. It contains some of our visions going forward, and we would love to hear your thoughts in the comment section below.

Community

One of the most exciting things about Q# for us is the growing community around it. Being rooted in the principles of quantum mechanics, quantum computing tends to have this air of unapproachability to the “uninitiated”. However, quantum computing builds on the notion of an idealized quantum system that behaves according to a handful of fairly easy to learn principles. With a little bit of acquired background in linear algebra, some persistence, and patience when wrapping your head around how measurements work it is possible to get knee-deep into quantum algorithms reasonably quickly!

Of course, a couple of good blog posts on some of these principles can help. We strive to actively support you in the adventure of exploring quantum algorithms by providing materials that help you get started, like our growing set of quantum katas. Our arsenal of open source libraries provides a large variety of building blocks to use in your quest of harnessing the power of quantum. One of the main benefits of open source projects is being able to share your work with all the people brave enough to explore the possibilities that quantum has to offer. Share your progress and help others build on your achievements! Whether in kata or library form, we welcome contributions of any size to our repositories. Let us know how we can help to make contributing easier.

Exchange among developers is one of the most important aspects of software development. It is omnipresent and vital to building a sustainable environment around a particular toolchain and topic. Thankfully, modern technology has made that exchange a lot easier than when the first computer programmers started their careers. We intend to make full use of the power of the internet and give a voice and a platform for discussions on topics related to Q# and quantum computing to developers around the world. The Q# dev blog is part of this effort. Contact us or comment below if you have an idea for a blog post or would like to hear more about a specific topic related to Q#. Establishing good feedback channels is always a challenging endeavor and in particular for a small team like ours. We would like this place to become a source of knowledge and exchange, a place where you can find the latest news and voice your take on them.

Growth

This brings us back to our plans for Q#. We have built Q# to make quantum development easier and more accessible. Of course, there were also a couple of other considerations that have played into that decision. For instance, we are anticipating the need to automate what is largely done in manual labor today, e.g. qubit layout and gate synthesis that are often still done on a case-by-case basis for each program and targeted hardware. When is the last time you worried about how error correction works on the hardware your code gets executed on? With qubits being an extremely scarce resource, and the long-term ambition to use quantum computing to address the most computationally intensive tasks that cannot be tackled with current hardware, the optimization of large-scale quantum programs needs to be a priority. We chose to develop our own language in order to have full control and flexibility over what information is represented how, and when it is used during compilation in order to be able to support a modular and scalable software architecture for executing quantum programs. But that’s a tale for another time. What is important is that these considerations are key factors in how we design and develop the language going forward.

A programming language is more than just a convenient set of tools for expressing an algorithm. It shapes the way that we think and reason about a problem, how we structure it and break it down into tasks when building a solution. A programming language can have a tremendous impact on our understanding of existing approaches, as well as how to adapt and combine them for our purposes. Particularly so when venturing into new territory.

Our goal is therefore to build a shared understanding of what it is we strive to accomplish, and to evolve Q# into the powerful language needed to drive progress in quantum programming. Our goal is to leverage the expertise of a community of language designers, compiler veterans, quantum physicists, algorithms and hardware experts, and a variety of software developers to shape a new kind of computing architecture. And we want you to be part of it.

Transparency

Since our 0.3 release at the beginning of November we have been eagerly working on not just the next release, but on defining and preparing the next steps in 2019. While we are in the middle of formulating our plans for the future, I want to give you a brief insight into some of our considerations.

As I am sure you have noticed, the support for data structures in Q# is minimal. While we do provide quite a few high-level language features for abstracting classical and quantum control flow, we intentionally omit some of the more object-oriented mechanisms such as classes. We anticipate remaining heavily focused on transformations that modify the quantum state, expressed as operations in Q#, as well as their characteristics and relations in the future. However, basic bundling of data and manipulations of such is of course an important aspect of many programs and we want to provide suitable mechanisms to express these in a way that allows to make abstractions, is convenient, and is resistant to coding errors. User defined types in the current setting have limited power besides an increased type safety. The “black box approach” to type parameterization currently restricts their usefulness; we do not provide a mechanism for dynamic reflection and it is not possible to apply operators or other type specific functionalities to argument items whose type is resolved for each call individually. In that sense, these items are “black boxes” that can merely be passed around. We want to do as much of the heavy lifting as possible statically in particular since debuggability of quantum devices is a huge challenge. There are several mechanisms one might consider alleviating the consequences of these decisions. On one hand, type constraints are a common mechanism used in several popular languages. In a sense, they can be seen as “specializations based on the properties of a type”. One could also pursue the stricter path of specializing based on the concrete type itself, de-facto adding a form of overloading that we currently explicitly prevent from being used. Either way, by clearly separating user defined types from tuples in the type system we have made a first step towards extending their power.

If you are curious to hear more about possible ideas for Q#, their benefits and caveats, or want to share some thoughts of your own, comment below! Contribute to the discussion and post your speculations to the question: What makes a quantum programming language “quantum”, i.e. what makes it particularly suited for quantum computing?

Join us

I hope you join us into a new year of pushing the boundaries of computation by participating in our coding competitions, contributing to our open source repositories, commenting on or writing blog posts and sharing your ideas and experiences!

How about a new year’s resolution of your own? Let us know what you expect to accomplish and how we can help you achieve your new year’s resolution around quantum programming in Q#!

Bettina Heim, Senior SDE, Quantum Software and Application
@beheim
Bettina Heim is a quantum physicist and software engineer working in the Quantum Architectures and Computation Group at Microsoft Research. She is responsible for the Q# compiler and part of the Q# language design team. Prior to joining Microsoft she worked on quantum algorithms, adiabatic quantum computing, discrete optimization problems, and the simulation and benchmarking of quantum computing devices.

Build an Azure IoT application with Cloud Explorer for Visual Studio

$
0
0

What we’ve heard and experienced ourselves is that when building applications, you have a frictionless experience when your code editor and tools are integrated and seamless. Yet when developing IoT apps, you often need to manage connected devices and send test messages between the device and IoT Hub at the same time that you’re debugging and working on your code. You’ll likely spend time switching between windows or even screens to monitor the messaging and many components of your development.

To ensure that the tools you need are close at hand, we’ve updated the Cloud Explorer for Visual Studio extension for IoT developers to enable you to view your Azure IoT Hubs, inspect their properties, and perform other actions from within Visual Studio. Cloud Explorer is installed by default if you selected the Azure Workload when installing Visual Studio. To access the latest features, you need to upgrade to Microsoft Visual Studio 2017 Update 9 or later, then download and install the latest extension from Visual Studio marketplace.

Here are some of the new features to help IoT developers easily interact with Azure IoT Hub, and the devices connected to it:

  • Interact with Azure IoT Hub
    • Send D2C messages to IoT Hub
    • Monitor D2C messages sent to IoT Hub
    • Send C2D messages to device
    • Monitor C2D messages sent to device
    • Invoke Direct Method
    • View and update device twin
  • Device management
    • List devices
    • Get device info
    • Create and delete devices
  • IoT Edge development support
    • Create IoT Edge deployment for device
    • List modules
    • View and update module twin

To learn more about what the IoT Hub enables and how to use the latest, check out the IoT Hub documentation.

Easy to Set Up

After you’ve installed Cloud Explorer, you can open Cloud Explorer view from Visual Studio menu View → Cloud Explorer. Sign in to your Azure account by clicking the Account Management icon if you haven’t done this before.

Expand Your subscription → IoT Hubs → Your IoT Hub, the device list will be shown under your IoT Hub node. Select one IoT Hub or device to inspect its properties or perform actions against the resource.

Now you have learned how to access your Azure IoT Hub resources.

Try the Tutorials

If you want to discover the Cloud Explorer features further, we offer the following walkthroughs where you will perform common IoT Hub management actions. To explore advanced or specific IoT scenarios, head over to check out our IoT Hub documentation, where we’re always adding new projects and tutorials.

Your feedback is also very important for us to keep improving and making it even easier to develop your IoT applications. Please share your thoughts with us by suggesting a feature or reporting an issue in our Developer Community

Chaoyi Yuan, Software Engineer

Chaoyi is a software engineer working on IoT tools. He’s currently focus on providing great tools for Visual Studio and Visual Studio Code users.

Visual Studio 2019 Preview 2 is now available

$
0
0

The second preview of Visual Studio 2019 is now available for download. This release contains a number of improvements and additions to the core experience and different development areas, many of which are a result of your direct feedback. As always, you can check out the release notes for more details or read on for the highlights.

Core IDE experience

Visual Studio 2019 will automatically download updates in the background while your computer is idle. This means you can continue using Visual Studio 2019 until it’s time to install. And, you will only need to wait for the actual installation of the update. The default will be set to “Download all, then install”, and you can modify this by going to Tools > Options > Environment > Product Updates.

In Preview 1, we introduced a new Per-Monitor Awareness (PMA) preview feature that is now enabled by default for users that meet the system requirements of .NET Framework 4.8 and Windows 10 April 2018 Update. Alongside the core IDE, multiple tool windows such as Toolbox, Breakpoints, Watch, Locals, Autos, and Call Stack should now render sharply across monitors with different display and scale configurations.

Search capabilities have improved in two places: the start window and inside the IDE. In the start window, you can now search for project templates by language, platform, and tags via the search box. Preview 2 introduces filters for menus, components, and templates during search in the IDE, as well as the capability to create and add new projects and items directly from the search box.

Based on your feedback, the new blue theme in Visual Studio 2019 has been updated by dialing down luminosity and increasing contrast. The draggable region has been improved as well by making the toolbar region also draggable. As a result, dragging the Visual Studio 2019 window should now be more natural.

The document health feature that was introduced with Preview 1 has been given a visual upgrade in Preview 2. Now, at a glance, you can see how many errors or warnings your document has, and clicking the control will bring up the error list. Code cleanup, which was introduced in Preview 1, has also been given its own control to quickly access the code cleanup features.

C++ development

C++ developers will notice quite a few improvements in this release. Check out the release notes for the full list, but here are some of the highlights:

  • You now have access to a fresh version of the MSVC compiler and to libraries that:
    • Bring you guaranteed binary compatibility with Visual Studio 2017 MSVC toolset and runtime
    • Add initial support for C++ 20 standards (specifically the “spaceship” operator i.e. <=> under /std:latest),
    • Enable OpenMP 4 SIMD vectorization as well as many codegen improvements for better runtime performance and build throughput, including a new compiler switch -Ob3 that provides more aggressive inlining
    • Provide new Code Analysis checks including the new Lifetime profile checker.

Plus, you can try out the latest C++ productivity improvements, including the newly-enhanced C++ Template IntelliSense, NULL->nullptr refactoring, quick fixes for missing #include and using namespace declaration, missing semicolons, and more.

C# development

Visual Studio 2019 Preview 2 adds a couple more new C# 8.0 language features on top of the ones that shipped in Preview 1 (Take C# 8.0 for a spin). Most notably, C# 8.0 pattern matching now allows recursive patterns, which can dig into the structure of an object, and switch expressions, which are a lightweight expression version of switch statements. To learn more, check out Do more with patterns in C# 8.0 on the .NET Blog.

F# development

A preview of the F# 4.6 language is now available in Visual Studio 2019 Preview 2. You can learn more about the language changes in the F# 4.6 Preview blog post. Additionally, we’ve revamped how the F# language service is initialized by Roslyn, which should result in a consistently faster solution load time for larger solutions.

.NET development

Visual Studio 2019 Preview 2 brings a range of new refactoring and codefix capabilities, such as sync namespace and folder name, pull members up, invert conditional expressions/logical operations, and many more. We’re also gradually rolling out new classification colors which are similar to Visual Studio Code. You can control these via Tools > Options > Environment > Preview Features.

Starting with this release, we are making project files for .NET SDK-style projects a first-class file type in Visual Studio and are supporting things like double-clicking a project node to open the project file and finding a project by name with Go To All (Ctrl + T). Additionally, .NET SDK-style projects will now use the new Integrated Console experience for F5 and Ctrl + F5 on console apps.

Code cleanup also now enables you to save collections of fixers as a profile. Now, if you wanted to apply a small set of targeted fixers frequently while you code and have another more comprehensive set of fixers to apply before preparing for a code review, you can configure profiles to address these different tasks.

Python development

You can now switch between different Python interpreters using the new Python Environments toolbar when editing Python files or working with projects or Open Folder workspaces.   Miniconda is available as an optional component during installation so you don’t have to separately install it to create conda environments. Additionally, you can now create Visual Studio Live Share sessions for collaboration on Python code. Check out the Python in Visual Studio 2019 Preview 2 blog post for more details.

Web and container development

If you’re developing with Node.js, you will find JavaScript debugging support for unit tests in this release. If ASP.NET is more your style, you will find that when publishing your application to Azure App Service, you can associate Azure Store and Azure SQL resources with your app as dependencies.

If you’re using containers, Visual Studio 2019 Preview 2 now supports debugging ASP.NET Core applications that use Alpine as a base image. There’s also support for the latest ASP.NET and .NET Core images.

Visual Studio Kubernetes Tools are now integrated in the Azure development workload for easy installation. This will add the Container Application for the Kubernetes project template to Visual Studio, which will automatically create a Dockerfile and Helm chart that you can use. This also enables you to add support for Kubernetes to an existing ASP.NET Core application by right-clicking the project and selecting Add > Container Orchestrator Support. After adding Kubernetes support, you can build, run, and debug your application in a live Azure Kubernetes Service (AKS) cluster with Azure Dev Spaces.

Mobile .NET development

For .NET developers using Xamarin to build mobile apps, Visual Studio 2019 Preview 2 has improved build performance if you use Xamarin.Android 9.1.1 or higher. Xamarin.Android now also supports the latest Android dex compiler (d8) and code shrinker (r8). The Android designer now natively supports Android Pie (9.0) and will show you improved status when loading. You can also use Go-To-Definition (Ctrl + Click) on resource URLs to navigate to the file or line where they are defined.

A new property panel has been added for Xamarin.Forms developers, enabling you to edit common attributes for controls. The Xamarin.Forms templates now use the latest Xamarin.Forms 4.0 release and include a new Xamarin.Forms Shell app that aims to reduce the complexity of a multi-platform app solution.

Last, but not least, load performance for new projects has been improved dramatically, showing performance gains of up to 50% in certain cases. When building apps, you can now also see more detailed build progress information by clicking the background tasks icon in the bottom left of the IDE.

Get started; share feedback

You can download Visual Studio 2019 Preview 2 here or update using the Visual Studio Installer. If you want to give it a spin without installing it, check out the Visual Studio images on Azure. Let us know of any issues you run into by using the Report a Problem tool in Visual Studio. You can also head over to the Visual Studio Developer Community to track your issues, suggest a feature, ask questions, and find answers from others. We use your feedback to continue to improve Visual Studio 2019, so thank you again on behalf of our entire team.

Angel Zhou Program Manager, Visual Studio

Angel Zhou is a program manager on the Visual Studio release engineering team, which is responsible for making Visual Studio releases available to our customers around the world.


Enhanced in Visual Studio 2019: Search for Objects and Properties in the Watch, Autos, and Locals Windows

$
0
0

Are you inspecting many variables at once in the Locals window? Tired of constantly scrolling through the Watch window to locate the object you are currently interested in? New to Visual Studio 2019 for most languages (with some exclusions such as Xamarin, Unity, and SQL), you can now find your variables and their properties faster using the new search feature found in the Watch, Autos, and Locals windows!

With the new search feature, you will be able to highlight and navigate to specified values contained within the name, value, and type columns of each watch window.

Find your keywords faster using search and highlighting

If you are a fan of scrolling to the items you want, highlighting will allow you to find what you want easier. As you start typing in the search bar, the highlighting of matches currently expanded on screen will occur, giving you a faster alternative to performing a large-scale search.

Navigate between your specified keywords quickly

You can execute a search query using ENTER or the right and left arrow icons (“find next” (F3) and “find previous” (Shift+F3), respectively) shown below. If you are not a fan of scrolling to the items you want, clicking the arrows are also used to navigate through each found match. We based the search navigation on a depth first search model, meaning that matches are found by diving as far into the selected variable as specified before looking for matches within the next variable. You don’t have to sit through the full search if you don’t want to because search can also be cleared and canceled at any time, whether the search is ongoing or not.

Search for items deeply nested in your code

Unable to find what you’re looking for on your initial search? We’ve provided a “Search Depth” drop down to find matches nested X number of levels deep into your objects, where levels are defined similarly to levels in a tree data structure context. This option gives you the power to choose how thorough you want to search inside your objects (up to 10 levels), letting you decide how long or short the search process takes.

When you are searching for items that are already expanded and visible on your screen, these items will always be returned as matches no matter what search depth you have specified. Having to loop back to the item you want after passing it can be a pain, so setting the search depth to 1 will allow you to navigate to previous matches using the “find previous” arrow icon.

Excited to start searching in the Watch, Autos, and Locals windows? Let us know in the comments!

For any issues or suggestions, please let us know via Help > Send Feedback > Report a Problem in the IDE. If you have any additional feedback about this feature, feel free to complete this brief survey.

Leslie Richardson, Program Manager, Visual Studio Debugging & Diagnostics
@lyrichardson01

Leslie is a Program Manager on the Visual Studio Debugging and Diagnostics team, focusing primarily on improving the overall debugging experience and feature set.

Debug your live apps running in Azure Virtual Machines and Azure Kubernetes

$
0
0

We are excited to announce that, in our Visual Studio Enterprise 2019 preview, we are expanding Snapshot Debugger support beyond Azure App Services hosting ASP.NET Core and ASP.NET applications to now also include Azure Virtual Machines (VM), Azure Virtual Machine scale sets (VMSS), and Azure Kubernetes Services (AKS)!

When Visual Studio 2017 Enterprise 15.5 became generally available, we introduced the Snapshot Debugger, an innovative diagnostic tool that enables you to quickly and accurately evaluate problems in their Azure production environments without stopping the process and with minimal performance impact.

When an unanticipated issue occurs in production, it can be difficult to replicate the exact conditions in your testing environment and almost impossible to do so on your local development machine. You might consider asking your DevOps team to “turn up” production logging but this relies on you having already anticipated where issues might occur prior to deployment. You may also request that a process dump be taken, but that requires perfect timing and some luck to capture the most important details, you also must gauge how your collection strategy might negatively imy pact performance.

The Snapshot Debugger provides a familiar and powerful debugging experience, allowing developers to set Snappoints and Logpoints in code, similar to debugger breakpoints and tracepoints. When a Snappoint is hit in your production environment, a snapshot is dynamically created without stopping the process. Developers can then attach to these snapshots using Visual Studio and see what’s going on with variables, Locals, Watches and Call Stack windows, all this while the live site continues to serve your customers.

Azure Virtual Machines/Azure Virtual Machine scale sets

For most PaaS scenarios, Azure App Service is more than capable of encapsulating a complete end-to-end experience. However, for developers and organizations that require greater control over of their platform and environment, VMs remain a critical option and Snapshot Debugger supports them in the latest preview of Visual Studio.

Once your VM/VMSS has been set up to host your ASP.NET or ASP.NET Core web application you can open your project in Visual Studio 2019, and click on the “Debug->Attach to Snapshot Debugger…” menu item, where you will now be able to select VM/VMSS as shown.

The UI experience remains almost identical but now you will be required to select an Azure Storage account to collect your snapshot logs and to share the snapshot collection plan (App Services will also require Azure Storage in Preview 2).

Selecting the “Install Remote Debugger Extension” option will prompt Visual Studio to install the extensions in Azure, which is necessary to view snapshots. This process also opens a specific set of ports (30398, 31398, 31399, 32398) to facilitate communication to your local machine, these ports are not required for retrieving and viewing logpoints.

Azure Kubernetes Services (AKS)

Azure provides an incredible cross platform experience and our debugging and diagnostics tools now provide feature parity in our Kubernetes service offerings.

Before attempting to use any of the Snapshot Debugger features in AKS it is vital that your Docker images include ASP.NET Core 2.2+ installed in a global location, as well as the correctly configured Snapshot Debugger and the requisite environment variables.

To help you enable support for Snapshot Debugger in AKS we have provided a repo containing a set of Dockerfiles that demonstrate the setup on Docker images. We support three variants of Linux (Debian, Alpine and Ubuntu) and they are organized according to the ASP.NET Core version, the OS platform, and the platform architecture.

For example, the ASP.NET Core 2.2 Debian 9 (Stretch) x64 Dockerfile is located at /2.2/stretch-slim/amd64/Dockerfile. This Dockerfile produces an image with Debian 9 x64 as the base with ASP.NET Core 2.2 Runtime, it includes the latest supported Snapshot Debugger backend package and sets the environment variables to load the debugger into your .NET Core application.

Try the preview

The latest Snapshot Debugger experiences are now in preview, download and try it out here.

This preview supports the following scenarios:

  • Azure App Services on the Windows OS running ASP.NET Core (2.0+) or ASP.NET (4.6.1+).
  • Virtual Machines on the Windows OS running ASP.NET Core (2.0+) or ASP.NET (4.6.1+).
  • Azure Kubernetes Services (Linux Docker Containers) running ASP.NET Core (2.2+).

If you have any issues using Snapshot Debugger, please review this guide on Troubleshooting and known issues for snapshot debugging in Visual Studio.

We would love to hear your feedback. To report issues, use the Report a Problem tool in Visual Studio. You’ll be able to track your issues on the Visual Studio Developer Community site where you can also ask questions and find answers.

Mark Downie, Program Manager, Visual Studio Diagnostics
@poppastring

Mark is a program manager on the Visual Studio Diagnostics team, working on Snapshot Debugger.

Become a Visual Studio for Mac super user with this Tips and Tricks Video Series

$
0
0

If you are a web, mobile or games developer and would like to know how to become more productive and efficient using Visual Studio for Mac then we’ve got you covered. Visual Studio for Mac is a powerful IDE for C# developers that work with Xamarin, .NET Core and Unity workloads. The new video series, hosted on the Visual Studio Toolbox, contains short, roughly 5-minute, videos that cover tips and tricks for specific tasks and may even unveil features you didn’t even know existed! The first few videos will be introducing Visual Studio for Mac and what you can do with it.

You don’t want to miss a single video in the series so make sure you subscribe now. We will be recording and releasing a new video each week over the next few weeks, and the links will be updated on the date specified below. The videos currently feature Program Managers, Cody Beyer (@cl_beyer) and Sayed Ibrahim Hashimi (@SayedIHashimi). You can also provide feedback using the Developer Community portal

Here are the links to all the videos:

Overview In this video, Sayed will give you a very brief overview of some of the types of applications you can develop with Visual Studio for Mac. Since this is a very short video, it just touches on some of the more common types of apps that can be developed. This is the first video in the Visual Studio for Mac Tips and Tricks series. The first few videos will be setting a foundation with some basic information on Visual Studio for Mac. Following that, each video will show one, or a few, tips and tricks for specific tasks.
Acquisition Visual Studio for Mac is our full-featured IDE for macOS, providing all the tools you need to create ASP.NET Core application, Unity games, Xamarin mobile apps, Azure Functions and so much more. Join Cody as he shows how to download and install Visual Studio for Mac.
Build Your First App In this video, Sayed will show you how you can create your first ASP.NET Core web application with Visual Studio for Mac. The application that will be developed is a web site that displays the emojis available on GitHub. The info for the emojis are retrieved using the GitHub API.
Launch Multiple Projects While developing applications, it’s common to need to debug, or simply launch, more than one project. In this video, Sayed will show you how you can do just that. You can launch more than one project on run, or debug, by creating a new Solution Run Configuration.
Work with Multiple Solutions 
(available 1/29/2019)
In this video, Sayed will show you how you can work with multiple solutions in Visual Studio for Mac. Specifically, he will demonstrate two ways to work with multiple solutions:
  1. How to open more than one solution in the same instance of the IDE
  2. How to open more than one instance of Visual Studio for Mac
Manage Projects with Git 
(available 1/29/2019)
Want to know how to “git” started with using Visual Studio for Mac? Join Cody as he introduces Git support in Visual Studio for Mac, from check-out to push.
Publish to Azure
(available 2/5/2019)
In this video, Cody will demonstrate how to log in and publish a web project to Azure. Join him and learn how to get the most out of Visual Studio for Mac by combining it with the power of Azure.
Customize the Look and Feel 
(available 2/5/2019)
No IDE is truly ready until it matches your unique style and preferences. In this video, Cody will walk you through the steps to enable dark mode, install custom editor color themes and change the interface language.
Refactoring Code
(available 2/12/2019)
Visual Studio for Mac offers the refactoring and suggestion engine that you know and love on Windows. Learn how to get the most out of the power of Roslyn in all of your projects using Visual Studio for Mac.
Using NuGet 
(available 2/12/2019)
Visual Studio for Mac supports NuGet for all of your dependency management needs. In this video, Cody will demonstrate how to add a NuGet package to your project, and how to connect Visual Studio for Mac to custom NuGet feeds.
Searching and Navigating 
(available 2/19/2019)
Learn how to be a keyboard wizard and navigate within your project with ease using Visual Studio for Mac. In this video, Cody shares his favorite tips and tricks for navigating around your code.
Using Navigate To
(available 2/19/2019)
In this video, Sayed will show you how you can improve your productivity when developing apps with Visual Studio for Mac using the Navigate To feature that allows you quickly find files, code, and more. Navigate To is a feature that is similar to the Visual Studio Quick Launch feature.

 

Tell us what you think!

We invite you to leave us a comment below and let us know what you think of the series. If these are helpful and valuable to our users, then we will record more videos and keep the series going. If there is another format that you think would be better, we would love to hear your thoughts.

Here are some useful links:

Cody Beyer, Program Manager
@cl_beyerCody Beyer is a Program Manager on the Visual Studio for Mac team at Microsoft. His primary areas of focus cover overall performance and reliability of the IDE. He is also interested in computer ethics and privacy and aims to create software that empowers and respects everyone.
Sayed Hashimi, Senior Program Manager
@sayedihashimiSayed Ibrahim Hashimi has a computer engineering degree from the University of Florida. He works at Microsoft as a Senior Program Manager creating better .NET Core, and ASP.NET Core, ­development tools in Visual Studio for Mac. Before joining the Visual Studio for Mac team, he worked on ASP.NET features in Visual Studio. Prior to joining Microsoft, he was a Microsoft Visual C# MVP. Sayed has written four book on MSBuild, http://msbuildbook.com and he is a co-founder of  the OmniSharp project.

A better multi-monitor experience with Visual Studio 2019

$
0
0

Visual Studio 2019 now supports per-monitor DPI awareness (PMA) across the IDE. PMA support means the IDE and more importantly, the code you work on appears crisp in any monitor display scale factor and DPI configuration, including across multiple monitors.

Visual Studio 2019 (left) with system scaling vs Visual Studio 2019 (right) with the PMA option enabled.

If you have used Visual Studio across monitors with different scale factors or remoted into a machine with a different configuration than the host device, you might have noticed Visual Studio’s fonts and icons can become blurry and in some cases, even render content incorrectly. That’s because versions prior to Visual Studio 2019 were set to render as a system scaled application, rather than a per-monitor DPI aware application (PMA).

System scaled applications render accurately on the primary display as well as others in the same configuration but have visual regressions such as blurry fonts and images when rendering on displays with different configurations. When working for extended periods of time, these visual regressions can be a distraction or even a physical strain.

Visual Studio 2019 Preview 1 included the core platform support for per-monitor DPI awareness and Preview 2 includes additional fixes for usability issues around scaling, positioning and bounding (e.g. content renders within the bounds of tool windows). Preview 2 also adds several more popular tool windows that now correctly handle per-monitor DPI awareness.

How to enable PMA for Visual Studio 2019

The easiest way to try the new PMA functionality is on Visual Studio 2019 Preview 2. You’ll need to have the Windows 10 April 2018 Update or a newer build installed along with the latest version of .NET Framework 4.8. If you’re still running Preview 1 then you also need to enable “Optimize rendering for screens with different pixel densities” in the Preview Features node of the Tools -> Options dialog.

There are many features where you’ll start to see Visual Studio render clear fonts and crisp images. Here’s a few of the most used UI in Visual Studio where you should notice a difference.

  • Core Shell
  • Menus and context menus
  • Most code editors
  • Solution Explorer
  • Team Explorer
  • Toolbox
  • Breakpoints
  • Watch
  • Locals
  • Autos
  • Call Stack

Visual Studio 2019 Preview 2 also fixes some of the usability issues affecting UI positioning, scaling and content bounding that were discovered in Preview 1.

Our goal is to have per-monitor awareness working across the most used features by the time we ship Visual Studio 2019. In future updates, we’ll continue enabling PMA across more areas and look forward to your feedback.

Tell us what you think!

We thank you for your ongoing feedback, and encourage you to install the latest Visual Studio 2019 preview, enable the PMA functionality, and tell us about your experiences through the Developer Community portal. Please upvote PMA related asks or create new ones whenever you feel a specific component (tool window, dialog, etc.) or issue has not being reported.

Reporting your experience alongside your display configurations, PMA feature state (on/off) and for bonus points, any screenshot or video showing the affected areas will help us resolve issues faster, and account for as many use-cases as possible.

Ruben Rios, Program Manager, Visual Studio
@rub8n

Ruben is a Program Manager on the Visual Studio IDE platform team. During his time at Microsoft, he’s helped build tools and services for web & mobile devs in both Visual Studio and the Microsoft Edge F12 dev tools. Before joining Microsoft, he was a professional web developer and has always been passionate about UX.

Microsoft Q# Coding Contest – Winter 2019

$
0
0

Are you new to quantum computing and want to improve your skills? Have you done quantum programming before and looking for a new challenge? Microsoft’s Quantum team is excited to invite you to the second Microsoft Q# Coding Contest, organized in collaboration with Codeforces.com.

The contest will be held March 1 through March 4, 2019. It will offer the participants a selection of quantum programming problems of varying difficulty. In each problem, you’ll write Q# code to implement the described transformation on the qubits or to perform a more challenging task. The top 50 participants will win a Microsoft Quantum T-shirt.

This contest is the second one in the series started by the contest held in July 2018. The first contest offered problems on introductory topics in quantum computing: superposition, measurement, quantum oracles and simple algorithms. The second contest will take some of these topics to the next level and introduce some new ones.

For those eager to get a head start in the competition, the warmup round will be held February 22-25, 2019. It will feature a set of simpler problems and focus on getting the participants familiar with the contest environment, the submission system and the problem format. The warmup round is a great introduction, both for those new to Q# or those looking to refresh their skills.

Another great way to prepare for the contest is to work your way through the Quantum Katas. They offer problems on a variety of topics in quantum programming, many of them similar to those used in the first contest. Most importantly, the katas allow you to test and debug your solutions locally, giving you immediate feedback on your code.

Q# can be used with Visual Studio, Visual Studio Code or command line on Windows, macOS or Linux, providing an easy way to start with quantum programming. Any of these platforms can be used in the contest.

We hope to see you at the second global Microsoft Q# Coding Contest!

Mariia Mykhailova, Senior Software Engineer, Quantum
@tcnickolas
Mariia Mykhailova is a software engineer at the Quantum Architectures and Computation group at Microsoft. She focuses on developer outreach and education work for the Microsoft Quantum Development Kit. In her spare time she writes problems for programming competitions and creates puzzles.
Viewing all 1039 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>