News

C# Dev Kit Update Helps Wrangle NuGet Packages and More in VS Code

Microsoft's C# Dev Kit extension for Visual Studio Code has been updated to more easily wrangle NuGet packages, run/debug .NET Aspire applications, see the active document in Solution Explorer and acquire the .NET SDK within the editor.

The C# Dev Kit helps C# developers in many ways, including code management in solution explorer and testing with integrated unit test discovery and execution. The VS Code extension, which reached general availability last October with the same licensing as the Visual Studio Community Edition, has now been installed more than 3.7 million times.

C# Dev Kit
[Click on image for larger view.] C# Dev Kit (source: Microsoft).

Here's a concise summary of what's new in the latest (April 2024) release as announced yesterday (May 7).

NuGet Wrangling
Developers can now manage NuGet packages directly from VS Code using new commands in the command palette.

Adding NuGet package to a project is simplified with the NuGet: Add NuGet Package command. If there are multiple projects in the solution, devs will be prompted to select the target project. After searching for packages by name, users can choose the desired version, upon which the tool will add the package to the project and update relevant files and references.

To update or removing NuGet packages, developers can now use the commands NuGet: Update NuGet Package and NuGet: Remove NuGet Package. These commands display the installed packages, allowing developers to make selections for updates or removals, with the necessary changes applied to project files and references.

Run/Debug .NET Aspire Applications
.NET Aspire is described as an opinionated, cloud-ready stack for building cloud-native applications with .NET.

Developers can now launch .NET Aspire projects from VS Code with the familiar Ctrl-F5 (Run without debugging) command, which will start a .NET Aspire application, launching the app host project along with associated front-end and API projects.

Debugging is also simplified with Start debugging command (F5), with all projects attaching to the debugger, allowing breakpoints across different parts of an application.

See the Active Document in Solution Explorer
With the new command .NET: Sync with Active Document, developers can quickly navigate to the active (currently open and focused) document in the Solution Explorer. Executed from the command palette, it will expand tree and highlight the active document in the Solution Explorer and scroll to it if necessary. Additionally, enabling the setting dotnet.automaticallySyncWithActiveItem ensures that the active document is always highlighted in the Solution Explorer when switching between documents.

Acquiring the .NET SDK within VS Code
Helping .NET newbies in the dev kit walkthrough is the ability to "Install .NET SDK" in the "Set up your environment" section, providing a fully integrated SDK install experience.

SDK Acquisition
[Click on image for larger view.] SDK Acquisition (source: Microsoft).

The May Sprint
The May Iteration Plan in GitHub lists a bunch of bug fixes along with features and improvements coming up including:

  • Improved experience for Add New Project/File #967
  • Create Class Interface, etc. #682
  • Create controller file #132
  • Refine file contents of new C# class file in Solution Explorer #128
  • Start Window #83

About the Author

David Ramel is an editor and writer at Converge 360.

comments powered by Disqus

Featured

  • GitHub Previews Agentic AI in VS Code Copilot

    GitHub announced a raft of improvements to its Copilot AI in the Visual Studio Code editor, including a new "agent mode" in preview that lets developers use the AI technology to write code faster and more accurately.

  • Copilot Engineering in the Cloud with Azure and GitHub

    Who better to lead a full-day deep dive into this tech than two experts from GitHub, which introduced the original "AI pair programmer" and spawned the ubiquitous Copilot moniker?

  • Uno Platform Wants Microsoft to Improve .NET WebAssembly in Two Ways

    Uno Platform, a third-party dev tooling specialist that caters to .NET developers, published a report on the state of WebAssembly, addressing some shortcomings in the .NET implementation it would like to see Microsoft address.

  • Random Neighborhoods Regression Using C#

    Dr. James McCaffrey from Microsoft Research presents a complete end-to-end demonstration of the random neighborhoods regression technique, where the goal is to predict a single numeric value. Compared to other ML regression techniques, advantages are that it can handle both large and small datasets, and the results are highly interpretable.

  • As Some Orgs Restrict DeepSeek AI Usage, Microsoft Offers Models and Dev Guidance

    While some organizations are restricting employee usage of the new open source DeepSeek AI from a Chinese company due to data collection concerns, Microsoft has taken a different approach.

Subscribe on YouTube

Upcoming Training Events