Menu
Getting your desktop application development project ready for Windows Store submission is easy now with Visual Studio 2017 Update 4. Once converted to a Windows App Package your app can take advantage of all the Windows 10 platform capabilities and start using new APIs and features on Windows 10. Visual Studio Enterprise is an integrated, end-to-end solution for teams of any size with demanding quality and scale needs. Whether it’s for a phone, desktop, or the cloud, Visual Studio makes it easier to build great software on PC and Mac. Visual Studio, MSBuild, NuGet.exe, and.NET now support a new Credential Provider plugin interface, which can be implemented by private package hosts like Azure Artifacts. Previously, only NuGet.exe and Visual Studio accepted Credential Providers. The latest version of this topic can be found at Desktop Applications (Visual C++). A desktop application in C++ is a native application that can access the full set of Windows APIs and either runs in a window or in the system console.
A great strength of C++ is the ability to target multiple platforms without sacrificing performance. If you are using the same codebase for multiple targets, then CMake is the most common solution for building your software. You can use Visual Studio for your C++ cross platform development when using CMake without needing to create or generate Visual Studio projects. Just open the folder with your sources in Visual Studio (File > Open Folder). Visual Studio will recognize CMake is being used, then use metadata CMake produces to configure IntelliSense and builds automatically. You can quickly be editing, building and debugging your code locally on Windows, and then switching your configuration to do the same on Linux all from within Visual Studio.
Teams working on these types of code bases may have developers who have different primary operating systems, e.g. some people are on Linux (and may be using the Visual Studio Code editor) and some are on Windows (probably using the Visual Studio IDE). In an environment like this, the choice of tools may be up to the developers themselves. You can use Visual Studio in an environment like this without perturbing your other team members or making changes to your source as is. If or when additional configuration is needed it is saved in flat json files that can be saved locally, or shared in source control with other developers using Visual Studio without impacting developers that are not using it.
![Visual studio for mac os x Visual studio for mac os x](/uploads/1/2/6/6/126646068/972220945.png)
Visual Studio isn’t just for Windows C and C++ development anymore. If you follow the tutorial below on your own machine, you will clone an open source project from GitHub, open it in Visual Studio, edit, build and debug on Windows with no changes to the project. Then Visual Studio will add a connection to a Linux machine and edit, build and debug it on that remote machine.
The next section shows you how to setup Visual Studio, followed by a section on how to configure your Linux target, and last the tutorial itself – have fun!
Setting up Visual Studio for Cross Platform C++ Development
First you need to have Visual Studio installed. If you have it installed already confirm that you have the Desktop development with C++ and Linux development with C++ workloads installed. If you don’t have Visual Studio installed use this link to install it with the minimal set of components for this tutorial selected. This minimal install is only a 3GB, depending on your download speed installation should not take more than 10 minutes.
Once that is done you are ready to go on Windows.
Configuring your Linux machine for cross platform C++ development
Visual Studio does not have a requirement for a specific distribution of Linux; use any you would like to. That can be on a physical machine, in a VM, the cloud, or even running on Windows Subsystem for Linux. The tools Visual Studio requires to be present on the Linux machine are: C++ compilers, GDB, ssh, and zip. On Debian based systems you can install these dependencies as follows.
2 | wget chmod+xcmake-3.11.18033000-MSVC_2-Linux-x86_64.sh |
You can see the options for running it with –help. We recommend that you use the –prefix option to specify installing in the /usr/local path as that is the default location Visual Studio looks for CMake at.
git clonehttps://github.com/bulletphysics/bullet3.git |
Now open the root project folder, bullet3, that was created by cloning the repo in Visual Studio. Use the menu option File > Open > Folder which will detect and use the CMakeLists.txt file or you can use File > Open > CMake to select the desired CMakeLists.txt file directly.
You can also clone a git repo directly within Visual Studio which will automatically open the folder when you are done.
As soon as you open the folder your folder structure will be visible in the Solution Explorer.
This view shows you exactly what is on disk, not a logical or filtered view. By default, it does not show hidden files. To see them, select the show all files button in the Solution Explorer.
Step 2 – Use targets view
When you open a folder that uses CMake, Visual Studio will automatically generate the CMake cache. This will take a few moments, or longer depending on the size of your project. The status of this process is placed in the output window. It is complete when you see the message “Target info extraction done”.
After this completes, IntelliSense is configured, the project can build, and you can launch the application and debug it. Visual Studio also now understands the build targets that the CMake project produces. This enables an alternate CMake Targets View that provides a logical view of the solution. Use the Solutions and Folders button in the Solution Explorer to switch to this view.
Here is what that view looks like for the Bullet SDK.
This gives us a more intuitive view of what is in this source base. You can see some targets are libraries and others are executables. You can expand these nodes and see the source that comprises them independent of how it is represented on disk.
Step 3 – Set breakpoint, build and run
For this tutorial, use an executable to get something that can just run and get into the debugger. Select AppBasicExampleGui and expand it. Open the file BasicExample.cpp. This is an example program that demonstrates the Bullet Physics library by rendering a bunch of cubes arranged as a single block that are falling and smash apart on hitting a surface. Next set a break point that will be triggered when you click in the running application. That is handled in a method within a helper class used by this application. To quickly get there select CommonRigidBodyBase that the struct BasicExample is derived from around line 30. Right click and choose Go to Definition. Now you are in the header CommonRigidBodyBase.h. In the browser view above your source you should see that you are in the CommonRigidBodyBase. To the right you can select members within to examine, drop that selection down and select mouseButtonCallbackwhich will take you to the definition of that function in the header.
Place a breakpoint on the first line within this function. This will trigger when you click a mouse button within the window of the application when launched under the Visual Studio debugger.
To launch the application, select the launch dropdown with the play icon that says “Select Startup Item” in the toolbar.
In the dropdown select AppBasicExampleGui.exe. Now press the launch button. This will cause the project to build our application and necessary dependencies, then launch it with the Visual Studio debugger attached. It will take a few moments while this process starts, then the application will appear.
Move your mouse into the application window, click a button, and the breakpoint will be triggered. This pause execution of your program, bring Visual Studio back to the foreground, and you will be at your breakpoint. You will be able to inspect the application variables, objects, threads, memory, and step through your code interactively using Visual Studio. You can click continue to let the application resume and exit it normally or cease execution within Visual Studio using the stop button.
What you have seen so far is by simply cloning a C++ repo from GitHub you can open the folder with Visual Studio and get an experience that provides IntelliSense, a file view, a logical view based on the build targets, source navigation, build, and debugging with no special configuration or Visual Studio specific project files. If you were to make changes to the source you would get a diff view from the upstream project, make commits, and push them back without leaving Visual Studio. There’s more though. Let’s use this project with Linux.
Step 4 – Add a Linux configuration
So far, you have been using the default x64-Debug configuration for our CMake project. Configurations are how Visual Studio understands what platform target it is going to use for CMake. The default configuration is not represented on disk. When you explicitly add a configuration a file CMakeSettings.json is created that has parameters Visual Studio uses to control how CMake is run, as well as when it is run on a remote target like Linux. To add a new configuration, select the Configuration drop down in the toolbar and select “Manage Configurations…”
The Add Configuration to CMakeSettings dialog will appear.
Here you see Visual Studio has preconfigured options for many of the platforms Visual Studio can be configured to use with CMake. If you want to continue to use the default x64-Debug configuration that should be the first one you add. You want that for this tutorial so can switch back and forth between Windows and Linux configurations. Select x64-Debug and click Select. This creates the CMakeSettings.json file with a configuration for “x64-Debug” and switches Visual Studio to use that configuration instead of the default. This happens very quickly as the provided settings are the same as the default. You will see the configuration drop down no longer says “(default)” as part of the name.
You can use whatever names you like for your configurations by changing the name parameter in the CMakeSettings.json.
Now that you have a configuration specified in the configuration dropdown Manage Configurations option opens the CMakeSettings.json file so you can adjust values there. To add a Linux configuration right click the CMakeSettings.json file in the solution explorer view and select Add Configuration.
This provides the same Add Configuration to CMakeSettings dialog you saw before. This time select Linux-Debug, then save the CMakeSettings.json file. Now in the configuration drop down select Linux-Debug.
Since this is the first time you are connecting to a Linux system the Connect to Remote System dialog will appear.
Provide the connection information to your Linux machine and click Connect. This will add that machine as your default remote machine which is what the CMakeSetttings.json for Linux-Debug is configured to use. It will also pull down the headers from your remote machine so that you get IntelliSense specific to that machine when you use it. Now Visual Studio will send your files to the remote machine, then generate the CMake cache there, and when that is done Visual Studio will be configured for using the same source base with that remote Linux machine. These steps may take some time depending on the speed of your network and power of your remote machine. You will know this is complete when the message “Target info extraction done” appears in the CMake output window.
Step 5 – Set breakpoint, build and run on Linux
Since this is a desktop application you need to provide some additional configuration information to the debug configuration. In the CMake Targets view right click AppBasicExampleGui and choose Debug and Launch settings.
This will open a file launch.vs.json that is in the hidden .vs subfolder. This file is local to your development environment. You can move it into the root of your project if you wish to check it in and save it with your team. In this file a configuration has been added for AppBasicExampleGui. These default settings work in most cases, as this is a desktop application you need to provide some additional information to launch the program in a way you can see it on our Linux machine. You need to know the value of the environment variable DISPLAY on your Linux machine, run this command to get it.
In my case this was :1. In the configuration for AppBasicExampleGui there is a parameter array “pipeArgs”. Within there is a line “${debuggerCommand}”. This is the command that launches gdb on the remote machine. Visual Studio needs to export the display into this context before that command runs. Do so by modifying that line as follows using the value of your display.
Now in order to launch and debug our application, choose the “Select Startup Item” dropdown in the toolbar and choose AppBasicExampleGui.
Now press that button or hit F5. This will build the application and its dependencies on the remote Linux machine then launch it with the Visual Studio debugger attached. On your remote Linux machine, you should see an application window appear with the same falling bunch of cubes arranged as a single block.
Move your mouse into the application window, click a button, and the breakpoint will be triggered. This pause execution of your program, bring Visual Studio back to the foreground, and you will be at your breakpoint. You should also see a Linux Console Window appear in Visual Studio. This window provides output from the remote Linux machine, and it can also accept input for stdin. It can of course be docked where you prefer to see it and it’s position will be used again in future sessions.
You will be able to inspect the application variables, objects, threads, memory, and step through your code interactively using Visual Studio. This time on a remote Linux machine instead of your local Windows environment. You can click continue to let the application resume and exit it normally or cease execution within Visual Studio using the stop button. All the same things you’d expect if this were running locally.
Look at the Call Stack window and you will see this time the Calls to x11OpenGLWindow since Visual Studio has launched the application on Linux.
What you learned and where to learn more
So now you have seen the same code base, cloned directly from GitHub, build, run, and debugged on Windows with no modifications. Then with some minor configuration settings build, run and debugged on a remote Linux machine as well. If you are doing cross platform development, we hope you find a lot to love here. Visual Studio C and C++ development is not just for Windows anymore.
Further articles
- Original Linux C++ announcement post, this goes into depth on Linux C++ projects that use msbuild to drive remote compilation.
Documentation links
- Open folder projects for C++ for any build system
- Download and setup the Linux workload, the root page for Visual Studio C++ Linux documentation
This section will be updated in the future with links to new articles on Cross Platform Development with Visual Studio.
Give us feedback
Use this link to download Visual Studio 2017 with everything you need to try the steps in this tutorial, then try it with your projects.
Your feedback is very important to us. We look forward to hearing from you and seeing the things you make.
As always, we welcome your feedback. We can be reached via the comments below or via email ([email protected]). If you encounter other problems with MSVC or have a suggestion for Visual Studio please let us know through Help > Send Feedback > Report A Problem / Provide a Suggestion in the product, or via Developer Community. You can also find us on Twitter (@VisualC).
Microsoft Build has always been a time when we deliver a wealth of developer-focused announcements. It’s an opportunity to share our vision for developer experiences across mobile, AR/VR, cloud, web, desktop, IoT and AI. This year, I’m excited to have brought this vision to life with more than a few exciting announcements:
For an overview of announcements across the company, check out Scott Guthrie’s blog post; but for a round-up of Visual Studio and .NET headlines, read on.
.NET Core 2.1 RC
As of today, .NET Core 2.1 Release Candidate (RC) is available with a “Go-Live” license to use in production. .NET Core 2.1 improves on previous releases with hard-won performance gains and many new features:
- ASP.NET Core SignalR. Developers have been using SignalR to build real-time web communication solutions since 2013 on the .NET Framework. The stack has been streamlined and improved to run on the cross-platform and higher performance .NET Core runtime. We also released SignalR as an Azure service.
- ASP.NET Core web platform enhancements including support for Razor UI in class libraries, improvements in building WebAPIs, security enhancements, a new Identity UI library and HttpClientFactory.
- Entity Framework Core 2.1 introduces significant capabilities like lazy loading, data seeding, value conversions, query types, and GroupBy translation.
- .NET Core 2.1 significantly improves build & runtime performance. It also introduces a new deployment and extensibility model for global tools.
- ASP.NET Core 2.1 is more than 15% faster than version 2.0. This means that when ASP.NET Core is released, it will top the TechEmpower benchmarks as the fastest mainstream web framework on the planet.
Of course, .NET Core remains free, cross-platform, and open source – just as it has been since 2014.
Learn more about .NET Core 2.1 RC.
Future of Windows Desktop Development
While we’re excited to release .NET Core 2.1 RC, we’re not stopping there. Today, we introduced the roadmap for .NET Core 3, which brings desktop development to our open source .NET stack. We are adding Windows Presentation Foundation (WPF) and Windows Forms on top of .NET Core. As always, developers building Universal Windows Platform apps will also continue to benefit from all the .NET Core improvements.
.NET Core 3.0 will enable Windows desktop apps use a globally installed .NET, or an app local copy, or build a single .EXE which includes .NET. Thus, .NET apps will no longer be impacted by system-wide updates. More importantly, this will allow us to make improvements to WPF and Windows Forms that we previously could not have done with .NET Framework without risking compatibility to existing apps
With .NET Core 3.0, developers will have the ability to share and easily integrate UI controls across all the major Windows desktop frameworks. You’ll be able to incorporate whatever UI controls make the most sense for your scenario, or even take a phased migration approach to modernizing your app’s UI. Developers will be able to seamlessly integrate almost all the Windows 10 API surface area into their .NET apps such as Cortana, Windows Hello, Windows ML, Rome, and more. And developers will be able to take advantage of the performance improvements and new API’s in .NET Core.
Developers targeting .NET Framework 4.8, the next version of .NET Framework, will also benefit from the improvements we plan to make such as the new Edge-based WebView control that they can host inside their apps, with more controls planned. And support for XAML Islands bringing UWP UI into existing applications.
This roadmap represents a significant investment in Windows desktop development by empowering developers to adopt the latest innovations in Windows 10 and .NET Core in their WPF and Windows Forms apps.
Visual Studio 2017, version 15.7
![Visual studio for mac Visual studio for mac](/uploads/1/2/6/6/126646068/800370770.png)
Our flagship IDE, Visual Studio, received a significant upgrade today with the announcement of Visual Studio 2017 version 15.7. John Montgomery’s blog post has a full run-down of all the new capabilities, but some of the more significant headlines include:
- Cloud development: You’ll find several improvements to the project scaffolding and unit testing. Additionally, you can publish Helm charts directly to Azure Kubernetes Service (AKS). You can now also directly publish .NET applications to Kubernetes containers. For your ASP.NET and ASP.NET Core applications, you can configure the Key Vault connected service directly from the IDE.
- Debugging: IntelliTrace’s new step-back debugging, first shipped in Visual Studio 2017 version 15.5, is now available for .NET Core applications. The feature automatically takes a snapshot of your application on each breakpoint and debugger step so you can step “back in time” to view previous application states.
- MSVC C++ 17 conformance: Today, we are happy to announce we have reached full C++ 17 conformance in MSVC with Visual Studio 2017 version 15.7. We also added ClangFormat support for C++ developers in the IDE. Developers can use ClangFormat to automatically style and format your code as you type, in a way that can be enforced across your development team.
- Python: This release contains an opt-in preview of the Python debugger based on the popular open source pydevd debug engine, offering improved performance for many debugging scenarios.
- iOS and Android mobile development with Xamarin: The XAML editing experience has been greatly improved with full IntelliSense support. iOS devices can be provisioned for development with a single click, saving developers a lot of time and steps. Android and iOS project templates have been re-written to use the latest modern navigation patterns and are now better organized for improved discoverability.
Visual Studio for Mac, version 7.5
Visual Studio 2017 wasn’t the only IDE to get an update. Today, we’re announcing Visual Studio for Mac version 7.5. This release includes bug fixes, performance improvements, and several new features:
- New editors for Razor, JavaScript, and TypeScript for building web projects
- Updated UI and templates for building serverless solutions with Azure Functions and .NET Core
- .NET Standard Library projects are now a fully supported option for sharing code between platforms when building Xamarin.Forms solutions.
- Preview support for Team Foundation Version Control (TFVC) in Team Foundation Server (TFS) and Visual Studio Team Services (VSTS) has arrived addressing one of our top UserVoice requests. Developers now have the option to use the existing Git source control integration or the new TFVC integration to manage their code.
Xamarin.Forms 3.0 General Availability
Today, we’re announcing immediate availability of Xamarin.Forms 3.0. Xamarin.Forms 3.0 delivers improved stability, faster performance, and new capabilities aimed at making it easier for you to create beautiful apps that work on Android, iOS, macOS, and Windows devices.
Xamarin.Forms 3.0 now builds with .NET Standard 2.0 using multi-targeting, while still maintaining support for PCL profiles and other .NET Standard versions. Projects load much faster when you use .NET Standard project types.
Xamarin.Forms 3.0 also includes a strong focus on developer productivity. Many developers are already familiar with the Visual State Manager already found in XAML for UWP and WPF. It’s now available for Xamarin.Forms, too. We’ve also heard from many ASP.NET developers who can build amazing layouts for the web using Flexbox and CSS. To empower these developers to build equally impressive layouts on mobile, we’ve added two features to Xamarin.Forms: FlexLayout and CSS. Xamarin.Forms 3.0 introduces both features without compromising the existing XAML experience desktop developers have come to know and love. Finally, because Xamarin apps are deployed globally, we also included right-to-left language support and many quality improvements in the 3.0 release.
Visual Studio Live Share Public Preview
Today, we announced the public preview of Visual Studio Live Share. Now any developer can use Live Share to collaborate in real-time with other developers, with instant bi-directional collaboration directly from their existing tools like Visual Studio 2017 and Visual Studio Code. With Visual Studio Live Share:
- It doesn’t matter if the developer sharing doesn’t use the same editor or have the same OS as you; join a Live Share session from your own development environment. No need to install project- specific dependencies or configure runtimes. You’ll view the project in your development tool, retaining all your customizations and themes.
- Each team member in a Live Share session can separately open files, navigate, edit, and refactor code. Your changes are instantly reflected in your teammate’s editor. You can quickly jump to a teammate’s location and see their cursor as they make edits or pin to follow their actions. Want to focus their attention? Highlight a piece of code and it will highlight on their screen as well.
- Use Live Share with any language on any application pattern, including serverless, cloud native, and IoT development. At Connect() 2017, we showed Live Share working with JavaScript and Node.js. Today, Live Share supports nearly every language supported by your development tool, including C#, Python, Java, Go, C++, and
- Full-context sharing – Use Live Share to collaborate across all parts of your development workflow: co-editing, shared debugging, shared terminals, and shared servers (ports).
Visual Studio IntelliCode
Visual Studio IntelliCode is a new capability that enhances everyday software development with the power of AI. Today, IntelliCode provides intelligent suggestions to improve developer productivity and code quality in the tool that developers love, Visual Studio. Our vision is to apply AI to empower developers across the entire development lifecycle.
At Build, we shared a sneak peak of IntelliCode, showing how it uses AI to deliver better context-aware code completions, guide developers to code to the patterns and styles of their team, find difficult-to-catch code issues, and focus code reviews on areas that really matter.
Developers can sign up for news and a future private preview, as well as gain access to an experimental extension at http://aka.ms/intellicode
Send us Your Feedback
Our developer tools and services are shaped by your feedback, so please let us know what you think. To download, install and read documentation for all today’s announcements, go to:
If you have any trouble, you can report a problem from inside the IDE on both Visual Studio and Visual Studio for Mac.
To track issues, ask questions and find answers, explore the Visual Studio Developer Community. Or, to engage with our team and other Visual Studio developers in real-time chat, try our new Gitter community (requires GitHub account). We welcome your product suggestions through UserVoice. And, should you need it, you can also get free installation help through Live Chat Support.
Install Visual Studio For Mac
Finally, don’t forget that we have three full days of announcements, deep dives, and developer interviews to share. You can live-stream or watch on-demand video later from the Microsoft Build website.
Visual Studio For Mac Professional
Happy coding.