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

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.

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.

Intelligent Productivity and Collaboration, from Anywhere

$
0
0

Developers today are encountering an overwhelming amount of complexity due to the growing emphasis on time-to-market, and a broader variety of technologies being used than ever before (e.g. polyglot apps, microservices). Additionally, teams are becoming more geographically distributed, which increases the need for efficient collaboration in order to maintain knowledge transfer within agile environments.

Over the past couple of years, we’ve spoken with thousands of developers, and learned that addressing these fundamental challenges required a new set of capabilities in your development tools and processes. As a result, our focus has been to significantly enhance individual productivity, improve team collaboration, and radically embrace workplace flexibility. To date, we’ve made a ton of progress (and are still iterating!) on the first two capabilities, thanks to feedback from the developer community:

  • Visual Studio IntelliCode helps enhance individual productivity by instilling intelligence into the IDE. It does this by making things like auto-completion smarter, based on an understanding of how APIs are used across thousands of open-source GitHub repositories.
  • Visual Studio Live Share facilitates real-time collaboration by enabling developers to edit and debug together, from the comfort of their favorite tools.
  • We also have a rich code navigation experience to improve asynchronous collaboration, and enable developers to deeply review PRs via multi-repo, cloud-based language services.

Today, we’re excited to share an early look of three new capabilities that are in private preview, and will enable developers to work from anywhere, and on any device, while virtually eliminating the amount of setup needed to start productively coding.

 

Remote-Powered Developer Tools

After we released Visual Studio Live Share, we immediately heard interest in an adjacent scenario: individual remote development. In fact, this had been the #1 feature request on GitHub for Visual Studio Live Share for over a year. Being able to develop against remote machines has numerous benefits, such as working on a different OS than the deployment target of your application, being able to leverage higher-end hardware, and having multi-machine portability. Today, many developers want to do remote development, but aren’t necessarily satisfied with the experience of using SSH + Vim or RDP/VNC.

Last week, the Visual Studio Code team released the Remote Development extensions (for Visual Studio Code Insiders) to enable connecting your local tools to a WSL, Docker container, or SSH environment, while retaining the full-fidelity, editing experience in Visual Studio Code (e.g. extensions, themes, debugging). Today, we’re excited to share an early look at Visual Studio Remote Development, which will enable Visual Studio users to achieve the same benefits, and go beyond the limits of their local dev machines. We’re starting with C# and C++, and look forward to working with the community to define the experience. Sign up for the private preview to get future updates.

 

Developing a C++ app without any local tools installed

 

Cloud-Hosted Development Environments

Having remote-capable tools unblocks a ton of developer scenarios, but on their own, they still require you to manually manage machines. We’ve heard loud-and-clear that developers are spending too much time setting up their developer environments, and that it can get in the way of onboarding new team members or enabling you to quickly move between tasks. To simplify this, we’re announcing the private preview of a capability that can provision fully-managed cloud-hosted development environments on-demand.

When you need to work on a new project, pick up a new task, or review a PR, you can simply spin up a cloud-based environment, and let the service take care of configuring it correctly. This allows you to spend more time coding, and little-to-no time installing dependencies. You can then connect to these environments using Visual Studio or Visual Studio Code (or both!) which ensures you can use the right tool for the job, and maximize your personal productivity, no matter where you are.

 

Creating a new cloud-hosted development environment directly within Visual Studio Code

 

Connecting to an existing environment and debugging it remotely

 

Browser-Based Web Companion

Developers are highly opinionated about their editor, and commonly spend countless hours customizing them. As a result, you’d want remote development and collaboration capabilities directly within your existing tools, where you spend the bulk of your time working. However, in some scenarios, it can actually be more convenient to perform a task in the browser, such as making a quick edit on-the-go, reviewing a PR, or joining a teammate’s Live Share session. To address this, we’re excited to share an early look at Visual Studio Online, a new web-based companion editor that compliments the Visual Studio family, and ensures you can work effectively from any device.

In the future, you will be able to navigate to https://online.visualstudio.com and access any of your remote environments. Because Visual Studio Online is based on Visual Studio Code, it will feel immediately familiar, and benefits from the rich ecosystem of extensions you already know and love – while supporting both the Visual Studio Code workspaces, as well as Visual Studio’s projects and solutions. Additionally, it will support IntelliCode and Live Share out-of-the-box, which ensures it provides the rich collaboration and productivity features developers need.

 

Editing a web application in the browser via Visual Studio Online

 

We Need Your Feedback!

We’re excited to share this progress, gather feedback, and learn how we can continue to improve team-based productivity moving forward. We believe that the combination of these experiences can address the needs of modern teams, and ensure you can achieve a high level of productivity, collaboration, and workplace flexibility. If you’re interested in getting your hands on early bits and chatting with our team, you can sign-up for the private preview here. We look forward to hearing from you and sharing more updates in the near future!

The post Intelligent Productivity and Collaboration, from Anywhere appeared first on The Visual Studio Blog.

Visual Studio 2019 for Mac version 8.1 Preview 1

$
0
0

Today, we are proud to announce the next major update for Visual Studio for Mac: Visual Studio 2019 for Mac version 8.1 PreviewIn this update, we are offering our new C# editor as the default experience in addition to introducing support for .NET Core 3 Preview and new project templates. We’ve also been working to improve performance and reliability across the board, based on feedback that we’ve heard from the Visual Studio for Mac community.  

You can install this update via the Updater inside Visual Studio for Mac by switching your channel from Stable to Preview. If at any time you would like to switch back to the Stable channel, you can do that via the Updater as well. We always welcome your feedback, so please make sure to share your thoughts with us via Developer Community or from the built-in Report a Problem tool in the IDE. 

A new default editor in VS for Mac: More speed, more reliability  

When we released Visual Studio 2019 for Mac in April, we offered an entirely new C# editor as an opt-in experienceWe wanted to ensure that the new editor meets our standards of performance and reliability before promoting it to the default editor within Visual Studio 2019 for Mac. Additionally, we wanted to ensure no major gaps existed in behavior or functionality between the legacy editor and the new editor. After a lot of testing and many conversations with our community, we believe the editor is now at a point where it can be the default experience.  

As the new editor shares all of its non-UI code with the editor in Visual Studio on Windows, we can now leverage the power of Visual Studio to provide a fast, fluent, and reliable experienceNumerous new features and capabilities were introduced in the new editor in Visual Studio 2019 for Mac, including: 

  • Improved typing responsiveness and scrolling speeds for a more fluid editing experience 
  • Modern editor features such as Multi-caret editing, Word Wrap, and Right-to-Left support 
  • Improved support for accented characters via macOS native input methods
  • An improved IntelliSense UI with faster performance 
  • New quick-action analyzers, shared with Visual Studio on Windows 

Visual Studio for Mac Editor

In this update, we have re-introduced many of your favorite and most requested features of the old editor, such as support for code snippets as well as various formatting and navigation tools, error highlights within the scrollbar and source control tabs. We have also made many improvements to the overall look and feel of the new editor, including refreshed tooltips and signature view adornments. Before we release the final version of Visual Studio 2019 for Mac 8.1, we also plan to add in-line lightbulbs adornments and Format Selection commands. 

Visual Studio for Mac - Editor Snippets

.NET Core 3 Preview Support

Visual Studio 2019 for Mac 8.1 now offers full support of the .NET Core 3 Preview SDK, which means you can get started with the latest and greatest that .NET Core has to offer! You can learn more about the new features and fixes offered in .NET Core 3 through the What’s New documentation.

To get started on using .NET Core 3 Preview within Visual Studio 2019 for Mac, you must first download and install the latest Preview SDK. To do this, download the macOS installer from the .NET Core Download page and run the installer to add .NET Core 3 support to your system.

Once .NET Core 3 Preview is installed, you can create a new .NET Core 3 project simply by using the .NET Core template and selecting .NET Core 3 at the SDK Selection page.

.NET Core 3.0 Selection

As support for .NET Core 3 is still in preview, not all features are currently in place. One such example is support for C# 8, which will be available in a future update of Visual Studio 2019 for Mac.

New ASP.NET Core templates to help build complex web applications

When building web applications today, it’s common to work with a rich client-side JavaScript library like Angular or React. In this release, we’re including four new templates in Visual Studio for Mac, the same templates provided by the dotnet command line tool and Visual Studio on Windows:

These templates provide a starting point with a sample client-side application written using each of the technologies above. The application consumes data provided by an ASP.NET Core API backend. The project files generated by these templates are setup to build the TypeScript and JavaScript assets when you run your application, so that you can stay focused on building your app without leaving the IDE.

We’ve also added a new Razor Class Library template to make it easier to package and reuse your Razor views, pages, controllers, page models, view components, and data models. You can learn more about this in the ASP.NET Core Razor Pages documentation.

Performance and reliability

As we talk to our user community, one theme is clear: performance and reliability need to continue to improve. We have worked to ensure that each release is more reliable and better performing than the last. In this release, we have worked to optimize NuGet restore time, reduce the time it takes to load an existing project, resolved an issue where Visual Studio for Mac would hang on saving files when working with Unity projects, and improved the reliability of the new editor. We have also fixed several crashes and hangs, all of which can be reviewed in our Release Notes.

Please share your thoughts

We encourage you to download and try out the release today! Our aim is to make .NET development on macOS a breeze, and this release is our next step on this journey. Check out our recently updated product roadmap to see what we’re working on next and share your feedback and suggestions! We strive to be 100% driven by customer feedback and we love to hear from you.

The post Visual Studio 2019 for Mac version 8.1 Preview 1 appeared first on The Visual Studio Blog.

Visual Studio Container Tools Extension (Preview) Announcement

$
0
0

Today we’re excited to announce the preview availability of the new Visual Studio Container Tools Extension (Preview) for Visual Studio 2019. This is an important milestone in the iteration of our container tooling in Visual Studio, as we try to empower developers to work better with their containerized applications directly from within the IDE. The current Visual Studio Tools for Containers provide a great getting started experience for developers building new containerized applications, as well as capabilities to containerize an existing application. The extension tooling, available today, will provide developers additional functionality to help with building and diagnosing containerized applications from right within Visual Studio. 

Prerequisites 

To use the new extension, you’ll need to have the following installed: 

Installation 

You can easily acquire and install the new extension from the Visual Studio Marketplace. 

 Visual Studio Marketplace

Alternatively, you can acquire the extension directly from within Visual Studio using the Extensions -> Manage Extensions menu option. On the Manage Extensions window, select Online from the left and then use the Search text box on the top right-hand corner to search for “Visual Studio Container Tools Extensions”. 

Install Container tools from Visual Studio

What is this new extension? 

The goal of the Container Tools window is to provide a GUI experience within Visual Studio 2019 to aid container developers in building and diagnosing their containerized applications. At a high level, the new tooling provides the following capabilities: 

  • Show a list of containers on your local machine 
  • StartStop, and Remove containers 
  • View containers log (stdout/stderr) – choose to stream logs or not 
  • Search log contents using the standard Visual Studio Find Dialog 
  • Show the folder & files in a running container 
  • Open files from a running container inside Visual Studio 
  • Inspect container port mappings and environment variables 

If you’re used to using the Docker CLI tool to interact with your containersthis window provides a more convenient way to monitor your containers in the IDE and helps you be more productive by not having to switch constantly between your IDE and separate command/terminal windows. 

Container filesystem in Visual Studio

Container Logs in Visual Studio

Note: Containers started (F5 and Ctrl+F5) from Visual Studio will not display logs in this tab, use the Output window instead. 

Please share your thoughts 

We are very excited about our new Container tooling extension and encourage you to download and try out it out today, whether you’re new to containers or an experienced docker developerYou can also check out the Visual Studio documentation for more details. 

Our goal is to make working with containers a great experience in Visual Studio 2019 and we have many other ideas for the Containers window we feel will help in building containerized applications. Wwant to hear from you, and we hope you can share your comments and suggestions on how we can make our tools work better for youDo this by opening a new issue at https://github.com/Microsoft/DockerTools/issues.  

The post Visual Studio Container Tools Extension (Preview) Announcement appeared first on The Visual Studio Blog.

Announcing the general availability of IntelliCode plus a sneak peek

$
0
0

We’re excited to announce the general availability of Visual Studio IntelliCode and offer a sneak peek at an up-and-coming feature we think you’ll love! With the release of Visual Studio 2019 Version 16.1, IntelliCode will be included with any workload supporting C#, C++, TypeScript/JavaScript, and XAML. However, only the C# and XAML models are currently generally available. C++ and TypeScript/JavaScript remain in preview at this time. We’ve learned so much from all of you in during our year in public preview and are thrilled for this next step. 

If you haven’t heard of IntelliCode,  it’s a set of AI-assisted capabilities that aims to improve developer productivity with features like contextual IntelliSense, code formatting and style rule inference. 

General Availability with Preview Perks 

IntelliCode is growing fast so we’ve also packed in some preview features you can try out if you’d like, no extra installations required. Preview features, such as such as C++ and TypeScript/JavaScript support and argument completion, will be disabled by default but you can easily enable any preview features via Tools > Options > IntelliCode. Check out our updated docs for a full list of preview features. 

A Quick PEEK: finding repeated edits 

Have you ever found yourself making a repeated edit in your code, for instance when you’re refactoring to introduce a new helper function? You might consider creating a regular expression search to find all the places in your code where the change is required – but that seems like a lot of work, so you resign yourself to the tedious and error prone task of going through the code manually. What if an algorithm could track your edits (locally of course), and learn when you were doing something repetitive like that after only a couple of examples? Repeated edit detection does just that, and suggests other places where you need that same change:

This feature is under development right now, and we’re looking to make it available in a future release of IntelliCode.  

Want to hear about new preview features like this first? Sign up to receive regular updates! 

Let us know what you think! 

IntelliCode has benefitted greatly from all the customer feedback we’ve received in the past year and we hope you’ll help us continue to improve by letting us know how IntelliCode is working for you! Feel free to let us know what you’d like to see next by filing feature requests or reporting issues via Developer Community. 

The post Announcing the general availability of IntelliCode plus a sneak peek appeared first on The Visual Studio Blog.

Visual Studio 2019 version 16.1 Preview 3

$
0
0

The third Preview version of Visual Studio 2019 version 16.1 is now available. You can download it from VisualStudio.com. Or, if you’re already on the Preview channel, just click the notification bell from inside your Visual Studio 2019 Preview installation to update. This latest preview contains a range of additions, including IntelliCode support by default, various C++ productivity enhancements, and .NET tooling updates. We’ve highlighted some notable features below, and you can see a list of all the changes in the Preview release notes.

IntelliCode

Today, at Build 2019, we announced the general availability of IntelliCode, which gives you contextual IntelliSense recommendations powered by a machine learning model trained on thousands of open source repositories. IntelliCode now comes installed by default with any workloads that support C#, C++, TypeScript/JavaScript, or XAML.

AI-assisted IntelliSense recommendations in Visual Studio
AI-assisted IntelliSense recommendations in Visual Studio

C# and XAML base models are enabled by default while preview features such as C++, TypeScript/JavaScript, and C# custom model support must be enabled using Tools > Options > IntelliCode. Check out our restructured docs to learn more.

C++

In Preview 3, you are now able to use your local Windows Subsystem for Linux (WSL) installation with C++ natively in Visual Studio without additional configuration or any SSH connections. In addition, AddressSanitizer is integrated directly into Visual Studio for WSL and Linux projects.

This release also provides the ability to separate your remote build machine from your remote debug machine in both MSBuild and CMake projects. Learn more about the new Linux features in the Visual Studio 2019 version 16.1 Preview 3 Linux roll-up post.

AddressSanitizer integration into Visual Studio
AddressSanitizer integration into Visual Studio

Quick Info tooltips, which appear when hovering over a method name, now offer you a link that will search for online docs to learn more about the relevant code construct. For red-squiggled code, the link provided by Quick Info will search for the error online. You will now also see colorized code in these tooltips to reflect their colorization in the editor. Learn more about quick info tooltip improvements in Preview 3 in the quick info improvements post on the C++ Team Blog.

Colorized code and Search Online functionality in Quick Info tooltips
Colorized code and Search Online functionality in Quick Info tooltips

Two new C++ Code Analysis quick fixes are available: C6001: using uninitialized memory <variable> and C26494 VAR_USE_BEFORE_INIT. These quick fixes are available via the lightbulb menu on relevant lines and enabled by default in the Microsoft Native Minimum ruleset and C++ Core Check Type rulesets, respectively.

New Code Analysis quick fixes
New Code Analysis quick fixes
 

.NET Tooling

You can now experience experimental IntelliSense completion for unimported types. IntelliSense suggestions for types in dependencies will be provided in your project even if you have not yet added the import statement to your file. You can toggle this option on/off by navigating to Tools > Options > Text Editor > C# > IntelliSense.

IntelliSense completion for unimported types
IntelliSense completion for unimported types

You can now use a new EditorConfig code style rule to require or prevent using directives inside a namespace. This setting will also be exported when you use the “Generate .editorconfig” button located in Tools > Options > Text Editor > C# > Code Style.

New Editorconfig rule for requiring or preventing usings inside namespaces
New Editorconfig rule for requiring or preventing usings inside namespaces
 

Tools option to prefer usings inside or outside of namespaces
Tools option to prefer usings inside or outside of namespaces
 

Use the latest features; give us feedback

To try out this preview of the latest features, update to Visual Studio 2019 version 16.1 Preview 3 online, via the notification bell inside Visual Studio, or by using the Visual Studio Installer.

We continue to value your feedback. As always, 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 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.

The post Visual Studio 2019 version 16.1 Preview 3 appeared first on The Visual Studio Blog.

General Availability For Azure Dev Spaces

$
0
0

Last week at Build, we announced general availability of Azure Dev Spaces. This add-on for Azure Kubernetes Service (AKS) enables your team to develop applications with cloud velocity. Run your service in a live AKS cluster and test it end-to-end, without affecting your teammates. Save maintenance time and money by allowing your entire dev team to share an AKS cluster, rather than requiring separate environments for each developer.

Azure Dev Spaces grew out of conversations that we had with companies that have large microservices-based cloud-native architectures. We learned that many of them built their own internal services that enable their developers to rapidly deploy new code to an isolated environment and test in the context of the entire application. These companies invested significant time and effort in building these capabilities. Azure Dev Spaces allows you to bring the same capabilities to your own team with just a few clicks.

In this post, we will show you how to get started with Azure Dev Spaces:

  1. If you’re a team lead or devops, you’ll learn how to set up your team’s AKS cluster for use with Azure Dev Spaces.
  2. If you’re a developer, you’ll learn how to run a service inside your team’s shared AKS cluster.
  3. You’ll also learn how to troubleshoot a bug using the Dev Spaces extension for VS Code. (An extension for Visual Studio is also available.)

Setting up your AKS cluster

Let’s say that you are running all the services that make up your application in an AKS cluster that serves as your team’s integration testing environment.

You can enable Dev Spaces on the cluster from the Azure portal or the Azure CLI. The screen below shows where to enable Dev Spaces in the Azure portal.

Then, you can configure the namespace where the services are running as a dev space, which enables Dev Spaces functionality.

Now that you’ve set up the cluster and the application properly, let’s see how individual developers on your team can test their code in the context of the full application using Dev Spaces.

Running a service in AKS

Suppose that a new developer named Jane has joined your team. You have a new feature that you want her to create inside an existing microservice called Bikes.

Traditionally, Jane would write the code for the feature on her local development workstation and do some basic validation of the feature by running the Bikes service locally. Hopefully your team has already invested in some automated integration tests that she can run to further validate that she hasn’t broken anything. But since she’s new to the application and its codebase, she might not feel confident checking in her code until she’s seen it working properly in the context of the full application. Automated tests can’t catch everything, and no one wants to break the team’s dev environment, especially on their first day on the team!

This is where Azure Dev Spaces can make Jane’s first check-in experience easy and positive.

Jane can create a child dev space called newfeature. The parent of newfeature is the dev space you configured when you initially set up Dev Spaces for your team, which is running the entire application.

The version of the application that runs in the child dev space has its own URL. This is simply the URL to the team’s version of the application, prefixed with newfeature.s. Azure Dev Spaces intercepts requests that come in with this URL prefix and routes them appropriately. If there is a version of the service running in the newfeature dev space, then Dev Spaces routes the  request to that version. Otherwise, Dev Spaces routes the request to the team’s version of the service, running in the root dev space.

End-to-End Testing

Jane can leverage this functionality to quickly test her changes end-to-end, even before she checks in her code. All she needs to do is run her updated version of the Bikes service in the newfeature dev space. Now she can access her version of the application by using the newfeature.s URL. Azure Dev Spaces will automatically handle routing requests between Jane’s updated version of Bikes (running in the newfeature dev space) and the rest of the services that make up the application (running in the parent dev space).

In the example shown below, the site currently shows a generic bicycle icon for each listed bicycle. One of Jane’s teammates has updated the database  to include a picture of the actual bicycle. Jane needs to update the Bikes service to pull this picture from the database and send it along to the upstream services:

A screenshot of a cell phone Description automatically generated

Troubleshooting a bug using Azure Dev Spaces

What if Jane discovers her changes didn’t work properly? First of all, her broken code is only running in her newfeature dev space. Her teammates’ requests still use the original version of Bikes running in the parent dev space. She can take her time troubleshooting the problem, knowing that she’s not blocking her teammates.

In addition, she can use the Azure Dev Spaces extensions for Visual Studio or Visual Studio Code to debug her code running live in the cloud with a single click. This allows her to quickly zero in on the problem, fix it, and validate her fix. She can even run and debug additional services inside the newfeature dev space, if the problem spans multiple services.

The following video shows debugging a Node.js service through VS Code, but the same capabilities are available for .NET Core and Java, inside Visual Studio or VS Code:

A screenshot of a cell phone Description automatically generated

Once Jane has fully tested her new feature using Azure Dev Spaces, she can check in with confidence, knowing that she has validated her code end-to-end.

Ready to get started?

If you’re ready to increase developer productivity while saving maintenance time and money, check out the documentation to get started with Azure Dev Spaces. The team development quickstart walks you through setting up a realistic multi-service application and then debugging one service in an isolated dev space. You can learn how to set up a CI/CD pipeline to deploy your entire application to a Dev Spaces-enabled cluster so that your devs can easily test their individual services in the context of the entire application. And dive into the article on How Dev Spaces Works if you want to learn all about the magic behind Dev Spaces. (Spoiler alert: There’s not a lot of magic, just a lot of standard Kubernetes primitives!)

The post General Availability For Azure Dev Spaces appeared first on The Visual Studio Blog.


Updates to synchronous autoload of extensions in Visual Studio 2019

$
0
0

Since announcing that Visual Studio 2019 v16.1 will block any extension from synchronously autoloading, we’ve seen a tremendous effort of both 1st and 3rd-party extensions to implement async background load. It’s been truly amazing to see the community of extension authors stepping up to the task. Many even did it long before we announced Visual Studio 2019.

The result is faster startup and solution load times for Visual Studio, as well as fewer UI delays cause by blocking operations on the main thread. So, a big THANK YOU to all extension authors for all the hard work to make this happen.

Control the behavior

By default, Visual Studio 2019 v16.1 blocks any synchronously autoloaded package from any extension and shows a notification to alert the user about it.

Yellow bar notification

What’s new is that the individual user can now control how they would like the extension to load. The reason for this change is two-fold.

First, most extensions now support async background loading, which improves startup and solution load performance across the board. Second, there exist a class of extensions developed and used internally in companies around the world that for various reasons cannot support async background load. It’s usually because they no longer have the source code or the person who originally built the extension is no longer working at the company.

To stop blocking synchronously autoloaded extensions, you can either click the Allow synchronous autoload on the yellow notification bar or check a new checkbox in the options dialog.

Extensions options

It’s important to stress that we really don’t recommend to anyone that they allow synchronous autoload, but we recognize the need to be able to unblock users and teams to do their job. Even when we know it leads to degraded performance of Visual Studio.

Group policy

To set this option for all team members, the IT admin can now set a registry key through Group Policy. When the Group Policy is set, it takes precedence over the individual user’s ability to change the option themselves, and the checkbox is greyed out and disabled.

Marketplace updates

Extension authors must still use AsyncPackage and enable background load. An update to the Marketplace shows errors when uploading any extension supporting Visual Studio 2019 that uses synchronous autoload. This update is in place since no extension can make assumptions about the users allowing synchronously autoloaded extensions.

Simply put

Here’s a bullet list to sum it up:

  • Marketplace requires autoload to be async and in the background
  • Users and IT admins can opt out of the blocking behavior (not recommended)
  • Autoloading extension should always happen asynchronously in the background

Again, thank you so much for your efforts to make Visual Studio perform better to the benefit of all users. We appreciate the hard work and understand that on many cases it took a considerable amount of work to make this happen. You have our sincerest respect and admiration.

The post Updates to synchronous autoload of extensions in Visual Studio 2019 appeared first on The Visual Studio Blog.

Code Reviews Using the Visual Studio Pull Requests Extension

$
0
0

The Pull Requests for Visual Studio is a new experimental extension that adds several code review tools to Visual Studio. This extension aims to make it easy for you to launch and view pull requests inside the integrated development environment (IDE) without needing to switch windows or use the web. We learned from customers that having a high-quality code review process is very important to increase productivity. To achieve that, this extension is enabling you to use existing and new Visual Studio code navigation, debugging and sharing capabilities in your code review process.

As of today, Pull Requests for Visual Studio only supports Azure DevOps and is available for you to download on the Marketplace. For those looking for GitHub pull request support, consider using the GitHub extension for Visual Studio.

This blog will focus on the basics of creating and reviewing a pull request, including:

  • Creating new pull requests
  • Reviewing pull requests
  • Providing expressive comments using markdown, emojis, and likes
  • Comparing code differences for over-the-shoulder and self-code review

With this extension you can also:

  • Review and checkout Pull Requests from Azure Repos
  • Get an inline peek to see more details about methods used in the code
  • View previous updates and understand how collaboration and discussion evolved over the course of the pull request

To learn more about this extension, please feel free to watch the following online demo, which talks about building the award winning app, Seeing AI, with Visual Studio 2019.

 

Creating a New Pull Request

After installing the pull requests extension and connecting to your Git repository on Azure DevOps, you can create a new pull request when pushing your branch to remote by clicking on create a pull request and filling the new pull request form.

Creating a pull request right after pushing your branch

 

You can also create pull requests using the pull requests page by navigating to Team Explorer > Home > Pull Requests and selecting New Pull Request.

Creating a pull request using the pull requests page

 

When you have local commits that have not been pushed to remote, the pull request extension reminds you to share your changes with remote before creating a new pull request. The Build & Code Analysis Results section will automatically expand and let you know about any failing unit tests, errors, and warnings. (Compatible only with C++, C#, and VB)

Un pushed changes warning + Build & Code Analysis Results

 

Reviewing Pull Requests

The pull requests page provides a summary of pull requests created by you and pull requests that have been assigned to you. You can do a brief review by opening the pull request, reviewing the changes that were made, and leaving comments or approving the pull request as shown below. To do a detailed review and be able to run and debug the pull request locally, you can use the Check out option.

Pull requests page

 

The pull requests details page is a focused screen that provides the pull request description and the discussion that the team is having. It also provides access to the code changes introduced by the pull request where you can add and view previous comments added by the team.

Reviewing the changes introduced by the pull request

 

You can add your comments by right clicking on the line of code that you would like to comment on and selecting Add Comment. Markdown and emojis are supported and you can use the preview option to view your comment before creating it. You can also reference bugs, team members, and other context that you might want to bring into your comment. Comments can also be marked as resolved which sends notification to their authors.

Comments and social coding

 

Reviewing Your Own Work

The Pull Requests extension for Visual Studio comes with a unique code diff tool that allows you to review your own work any time you want before creating a pull request. This allows you to see a history of changes as you code, which can be helpful when you are conducting over-the-shoulder code review and want to focus on the introduced code changes. To turn on code diff click on the Comparisons button on the tool bar.

Code diff (comparison)

 

With the Pull Requests extension, we now have integrated pull requests and code reviews inside of Visual Studio.

 

We Need Your Feedback!

We continue to value your feedback. As always, 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 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.

 

Install the Pull Requests extension & give us feedback!

The post Code Reviews Using the Visual Studio Pull Requests Extension appeared first on The Visual Studio Blog.

Visual Studio 2019 version 16.1 now generally available (and 16.2 Preview 1 as well)

$
0
0

Today, we are making Visual Studio 2019 version 16.1 generally available, as well as the first preview release of Visual Studio 2019 version 16.2. You can download both versions from VisualStudio.com. If you already have Preview installed, you can alternatively click the notification bell from inside Visual Studio to update. We’ve highlighted some notable features below and you can also see a list of all the changes in the current release notes or the Preview release notes. 

What to expect in 16.1 today 

Let’s start with Visual Studio IntelliCode which we made generally available at //Build 2019. IntelliCode now comes installed with any workload that supports C#, C++, TypeScipt/JavaScript, or XAML. IntelliCode provides AI-enhanced IntelliSense, so as you type, the context of the code will be used to recommend the next API you might use, rather than a simple alphabetical list. If you work with multiple monitors, and multiple resolutions, with Per-Monitor-Awareness, you will find that in most cases, your IDE and tool windows will scale appropriately for crisp visuals too. Finally, Visual Studio Search will now display Most Recently Used results to help you get to projects faster. 

For .NET developers, we’ve added new .NET productivity features such as one-click code cleanup on projects and solutions, a new toggle block comment keyboard shortcut and new refactoring capability to move types to other namespaces. But that’s not all! You now have improved IntelliSense that provides completion for unimported types and improvements to the .editorconfig integration. Finally, we have a preview XAML Designer for .NET Core 3.0 WPF development. 

Visual Studio 2019 version 16.1 also has several new features specific to the Linux Development with C++ workload: native support for the Windows Subsystem for Linux (WSL)AddressSanitizer integration, the ability to separate build and debug targets, and logging for remote connections. We also introduced a bunch of improvements to our CMake support including Clang/LLVM support for CMake projects, better vcpkg integration, and enhanced customizability for importing existing caches.  

 C++ Improvements

We continuously strive to make Visual Studio faster and more efficient. When we started 1.5 years ago, the average load time was 68 seconds for 161-sized solution and the Test Explorer took over 5 minutes to load time. With the latest release this has now been cut to 5 and 24 seconds respectively as shown below:

Performance

Test Explorer UI Updates (16.2) 

One of the focus areas for version 16.2 have been enhancements to the Visual Studio Test Explorer where we have incorporated a lot of community feedbacto help you become more productive by keeping the developer inner loop as tight as possible. The update Test Explorer provides better handling of large test sets, easier filtering, more discoverable commands, tabbed playlist views, and the addition of customizable columns that let you fine tune what test information is displayed. 

 Test Explorer in Visual Studio 2019

You can now easily view the total number of failing tests at a glance and filter by outcome with the summary buttons at the top of the Test Explorer. 

Filter buttons

You can also customize what information is shown for your tests by selecting what columns are displayed! You can display the Duration column when youre interested in identifying slow performing tests or you can use the Message column for comparing resultsThis table layout mimics the Error List table in its customizability. The columns can also be filtered using the filter icon that appears when hovering over the column header. 

Adjustable and filterable columns

Additionally, you now can specify what is displayed in each tier of the test hierarchy. The default tiers are Project, Namespace, and then Class, but you can also select Outcome or Duration groupings. 

Customizable hierarchy 

Playlists can be displayed in multiple tabs and are much easier to create and discard as needed. Live Unit Testing also gets its own tab that displays all tests currently included in Live Unit Testing so you can easily keep track of Live Unit Testing results, separate from the manually run test results. Live Unit Testing, is a Visual Studio feature that automatically runs any impacted unit tests in the background and presents the results and code coverage live in the Visual Studio IDE in real time. 

Playlists and Live Unit Testing tab 

Read about all the new updates in the release notes. 

Visual Studio integration with the Azure SignalR Service (16.2) 

If you are building Web Apps or services that are deployed and hosted in Azure App Service, then you may be using the Azure SignalR Service too, to enable real-time communication to enable you to route WebSocket traffic in a more efficient and scalable way. When developing these apps in Visual Studio 2019 16.2 Preview 1, you will now have a smoother experience to create and configure Azure SignalR Service  automatically during the publish phase to Azure App Service 

Give it a try today and let us know what you think 

We encourage everyone to update to Visual Studio 2019 version 16.1 by downloading directly from VisualStudio.com and we would also invite you to try out the 16.2 Preview 1 release by downloading it online, or updating via the notification bell inside Visual Studio. You can also use the Visual Studio Installer to install the update.

We are continuously driven by your feedback, so we look forward to hearing what you have to say about our latest release. If you come across any issues, make sure to let us know by using the Report a Problem tool in Visual Studio. Additionally, you can head over to 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. 

 

The post Visual Studio 2019 version 16.1 now generally available (and 16.2 Preview 1 as well) appeared first on The Visual Studio Blog.

Azure IoT Edge Tools Extension (Preview) Announcement

$
0
0

We’re excited to announce the preview availability of the new Azure IoT Edge Tools Extension (Preview) for Visual Studio 2019. The extension provides a rich set of functionalities to support development of IoT Edge solutions with Visual Studio 2019:

  • New Azure IoT Edge project targeting different platforms (Linux amd64, Linux arm32v7, Windows amd64)
  • Add a new IoT Edge module (C#/C) to solution
  • Edit, build and debug IoT Edge modules locally on your Visual Studio machine
  • Build and push docker images of IoT Edge modules
  • Run IoT Edge modules in a local or remote simulator
  • Deploy IoT solutions to IoT Edge devices (with Cloud Explorer)

Prerequisites

  • Visual Studio 2019: “.NET desktop development” and “Azure development workload” workload installed; “Windows desktop development with C++” is needed if you plan to develop C modules
  • Docker Desktop. You need to properly set the Docker CE running in Linux container mode or Windows container mode.
  • To set up local development environment to debug, run, and test your IoT Edge solution, you need Azure IoT EdgeHub Dev Tool. Install Python (2.7/3.6), then install iotedgehubdev by running below command in your terminal. Make sure your Azure IoT EdgeHub Dev Tool version is greater than 0.8.0.
    pip install --upgrade iotedgehubdev

Installation

There are two options to install the new extension:

  • Download and install the new extension from the Visual Studio Marketplace.
  • Alternatively, you can install the extension directly from within Visual Studio 2019 using the menu Extensions -> Manage Extensions. In the Manage Extensions window, select Online from the left panel and input edge in the search box on the top-right to search and download “Azure IoT Edge Tools for VS 2019 [Preview]”.

How to use this extension?

Please refer the following tutorials to get started:
Use Visual Studio 2019 to develop and debug modules for Azure IoT Edge (Preview) 
Easily Develop and Debug Azure IoT Edge C Modules with Azure IoT Edge Tools
Visual Studio Azure IoT Edge Tools document repo

Please don’t hesitate to give it a try! Your feedback and suggestions are 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 Visual Studio Azure IoT Edge Tools repo.

The post Azure IoT Edge Tools Extension (Preview) Announcement appeared first on The Visual Studio Blog.

Visual Studio Extensibility Day 2019 was a hit

$
0
0

On Friday, May 10th we hosted both internal and external Visual Studio extension authors in the Workshop room in building 18 on the Microsoft Campus in Redmond. It was a full day event with keynotes and sessions for 60 attendees – half of which attended //build earlier that same week, and half who came just for the Extensibility Day.

Attendees

They were a mix of old VSIP Partners, hobbyists, 1st-party MSFT teams and for-profit 3rd-party extenders. About half the attendees extended their stay for the //build conference to be able to attend the event. The rest came from all over the world and some flew to Redmond just to be able to attend Extensibility Day.

We’ve done similar events in the past exclusively for the VSIP Partners, but this was the first time we invited the larger extensibility community. For a lot of the attendees, this was their first time talking to- and socializing with other extension authors in person.

Agenda

To kick off the event, Corporate Vice President John Montgomery, and Director of Program Management Amanda Silver each gave a keynote. After that, sessions about various extensibility topics filled the rest of the day, including:

All sessions were highly technical and with lots of demos.


Amanda giving her keynote about the future of Visual Studio (photo by @kosmosebi)

After the session ended, we went to the Microsoft Company Store and Visitor Center followed by drinks and dinner at the Boardwalk restaurant in the heart of the Microsoft campus. People stayed until they closed.

Addressing pain points

During the day, the attendees helped identify their main pain points and produced a prioritized list of documentation/samples for us to provide as well as organizing our backlog of features to implement. Then they voted on the priority of each item and these are the results:

Top 5 missing pieces of documentation (in prioritized order):

  1. How to run and write integration tests
  2. How to debug and profile performance and memory issues
  3. DTE or IVs* – which one to use, how and when?
  4. How to access telemetry data collected by VS about our extensions
  5. How to target multiple versions of VS

Top 5 missing features (in prioritized order):

  1. Added integration test tooling
  2. Develop extensions in .NET Core
  3. Define VSCT from code instead of XML
  4. Marketplace extensions should have a private preview feature
  5. Ability to revert extensions to earlier versions

Remote-powered developer tools

A few weeks ago, we announce plans to enable a remote-powered developer experience for Visual Studio. It was met with great interest by the attendees who had a lot of questions as to how it relates to extension development. It’s still early and there are a lot of unknowns for us still to investigate. We’ll make sure to keep everyone in the loop as we know more. Stay tuned on this blog for that information.

Late notice

We sent out the invitation a bit late, so we were afraid that people wouldn’t be able to make it with such short notice. If you were among the people who couldn’t make it, I do apologize and ensure you that next year we send the invitations out much earlier.

Feedback about the event

The attendees filled out an evaluation form online after the event and the feedback was overwhelmingly positive. Everything from the list of sessions, the backlog prioritization, to the food served for lunch all received a top rating.

I really enjoyed visiting the campus and getting a chance to meet the team and other extension authors. I found that hearing about possible future direction for VS, participating in documentation/backlog prioritization and getting a broader sense of the ecosystem all really helped me answer questions about where to head next for CodeMaid. – Steve Cadwallader, author of CodeMaid

There were room for improvements too, and the top suggestions for next time are:

  1. More time to mingle and socialize with fellow extenders
  2. More hands on and Q&A time with the Visual Studio team
  3. Let the attendees vote on what sessions to see at time of registration

To summarize; this was a great event and I hope we can continue to do events like this every year. Thanks to all the attendees for coming and help making the day one to remember for all of us.

The post Visual Studio Extensibility Day 2019 was a hit appeared first on The Visual Studio Blog.

Viewing all 1039 articles
Browse latest View live