---
title: ".NET Boxed Visual Studio Integration - Muhammad Rehan Saeed"
description: "You can now create .NET Boxed projects directly from Visual Studio. Here's a short post showing you how."
canonical_url: "https://rehansaeed.com/dotnet-boxed-visual-studio-integration/"
last_updated: "2021-05-27T11:00:00+00:00"
meta:
  author: "Muhammad Rehan Saeed"
  keywords: ".NET Boxed,C#,.NET,ASP.NET"
  "og:description": "You can now create .NET Boxed projects directly from Visual Studio. Here's a short post showing you how."
  "og:image": "https://rehansaeed.com/_og/s/o_8660944516a6b688.png"
  "og:image:alt": ".NET Boxed Visual Studio Integration - Muhammad Rehan Saeed"
  "og:image:height": "630"
  "og:image:type": image/png
  "og:image:width": "1200"
  "og:title": ".NET Boxed Visual Studio Integration"
  "twitter:image": "https://rehansaeed.com/_og/s/o_8660944516a6b688.png"
  "twitter:image:alt": ".NET Boxed Visual Studio Integration - Muhammad Rehan Saeed"
---

> Index of every page on this site: [llms.txt](https://rehansaeed.com/llms.txt)

# [.NET Boxed Visual Studio Integration](https://rehansaeed.com/dotnet-boxed-visual-studio-integration/)

Posted 27 May 2021 - **1 min read**

![Visual Studio](https://rehansaeed.com/_ipx/f_png&s_2560x1440/images/hero/Visual-Studio-1366x768.png)

A few weeks ago [Scott Hanselman blogged](https://www.hanselman.com/blog/dotnet-boxed-includes-prescriptive-templates-for-net-core) about creating `dotnet new` based projects directly from Visual Studio. Unfortunately, at that time Visual Studio 16.9 didn't properly support full solution templates and only supported project templates.

Happily, Microsoft just released [Visual Studio 16.10](https://devblogs.microsoft.com/visualstudio/visual-studio-2019-v16-10-and-v16-11-preview-1-are-available-today/) and one of the things they didn't talk about was that it now adds a user interface for creating solutions from `dotnet new` templates.

Given that I author the [.NET Boxed](https://github.com/Dotnet-Boxed/Templates) solution and item templates, I thought I'd run through how it's done.

# Link to this sectionStep by Step

The first step is to install a `dotnet new` based solution/project/item template NuGet package. Sadly, this step is still command line only but there are plans to add a UI so you can search for and install templates all through Visual Studio.

```powershell
dotnet new --install Boxed.Templates
```

Next we can fire up Visual Studio and go to the 'New Project' dialogue. You can select '.NET Boxed' from the 'Project type' menu on the top right to see all .NET Boxed project templates.

![Visual Studio new project dialogue](https://rehansaeed.com/_ipx/f_png&s_2560x1700/content-images/posts/2021/dotnet-boxed-visual-studio-integration/images/NewProject-1536x1020.png)

The next step is where we can give the project a name as usual and decide where we want to store it on disk.

![Visual Studio configure project dialogue](https://rehansaeed.com/_ipx/f_png&s_2560x1700/content-images/posts/2021/dotnet-boxed-visual-studio-integration/images/ConfigureProject-1536x1020.png)

Finally, we get to the new interesting bit, where we can select from the many options that .NET Boxed templates provide:

![Visual Studio additional information dialogue](https://rehansaeed.com/_ipx/f_png&s_2560x3236/content-images/posts/2021/dotnet-boxed-visual-studio-integration/images/AdditionalInformation-1536x1942.png)

Finally, we can hit 'Create' and start getting productive in Visual Studio.

![New Visual Studio solution](https://rehansaeed.com/_ipx/f_png&s_2560x1652/content-images/posts/2021/dotnet-boxed-visual-studio-integration/images/VisualStudio-2256x1455.png)

That's it! Simple isn't it.

## Web Mentions

[What's this?](https://en.wikipedia.org/wiki/Webmention)

### 0 Linked

### 0 Replies

## GitHub Comments

### 16 Comments

[Comment on GitHub](https://github.com/RehanSaeed/rehansaeed.github.io/issues/359)

[![mike1880](https://avatars.githubusercontent.com/u/17103824?v=4)](https://github.com/mike1880)

### [mike1880](https://github.com/mike1880)

28 May 2021 (edited 28 May 2021)

Doesn't work on VS 2019 16.10 for me. Works on 2019 16.11 Preview.

Edit: no, I tell a lie. It doesn't work for me in 16.11 either. It creates a minimal solution file and a project folder then apparently dies without creating any other project files.

[![RehanSaeed](https://avatars.githubusercontent.com/u/2270364?v=4)](https://github.com/RehanSaeed)

### [RehanSaeed](https://github.com/RehanSaeed)

Owner

28 May 2021 (edited 28 May 2021)

[@mike1880](https://github.com/mike1880) Which project did you try?

[![mike1880](https://avatars.githubusercontent.com/u/17103824?v=4)](https://github.com/mike1880)

### [mike1880](https://github.com/mike1880)

28 May 2021

Asp.Net Core API Boxed. No source control, no reverse proxy, no analytics, cloud provider Azure, xml formatter XMLSerializer. I have .Net 6.0 installed which sometimes causes problems (e.g. WinUI projects) if that's any help.

[![RehanSaeed](https://avatars.githubusercontent.com/u/2270364?v=4)](https://github.com/RehanSaeed)

### [RehanSaeed](https://github.com/RehanSaeed)

Owner

28 May 2021 (edited 28 May 2021)

Thanks [@mike1880](https://github.com/mike1880), that seems like a bug in VS so I raised [sayedihashimi/template-sample#29](https://github.com/sayedihashimi/template-sample/issues/29). Lets see what answer we get. In the mean time, you can continue to use the CLI which does work.

[![lohithgn](https://avatars.githubusercontent.com/u/2450336?v=4)](https://github.com/lohithgn)

### [lohithgn](https://github.com/lohithgn)

30 May 2021

[@RehanSaeed](https://github.com/RehanSaeed) i left a comment on issue [sayedihashimi/template-sample#29](https://github.com/sayedihashimi/template-sample/issues/29) ....

basically the template works from VS when we enter values to all the fields...

[![oising](https://avatars.githubusercontent.com/u/1844001?v=4)](https://github.com/oising)

### [oising](https://github.com/oising)

1 June 2021

Doesn't appear in the dropdown for project types at all in v16.10 (final). I tried uninstalling and reinstalling the templates (because I had previously installed them for earlier version of VS).

Btw, this might help, but I have both VS 2019 16.10 and 16.11 (preview) installed.

[![sayedihashimi](https://avatars.githubusercontent.com/u/1283154?v=4)](https://github.com/sayedihashimi)

### [sayedihashimi](https://github.com/sayedihashimi)

3 June 2021

It should work in 16.10+, when a blank solution is created that happens because the template has a required parameter, that has no default value, and is not provided by the user.  
 We should update Visual Studio to block project creation at that time.  
[@RehanSaeed](https://github.com/RehanSaeed) I would recommend that you provide default values for all required parameters. Even after we block project creation for this case, it won't be a great experience for users, especially since the template has lots of parameters (it may be difficult for the user to find the missing parameter that needs to be filled in).

[![RehanSaeed](https://avatars.githubusercontent.com/u/2270364?v=4)](https://github.com/RehanSaeed)

### [RehanSaeed](https://github.com/RehanSaeed)

Owner

7 June 2021

This now seems to be fixed in [Boxed.Templates version 6.3.3](https://www.nuget.org/packages/Boxed.Templates/6.3.3). Thanks for identifying the issue.

[![m-meier](https://avatars.githubusercontent.com/u/370149?v=4)](https://github.com/m-meier)

### [m-meier](https://github.com/m-meier)

9 June 2021

I have the same problem as [@oising](https://github.com/oising), none of the templates appear in the new project dialog (16.11 preview). I tried with and without the preview flag (Show all .NET Core templates in the New Project dialog). "dotnet new" shows the templates.

[![RehanSaeed](https://avatars.githubusercontent.com/u/2270364?v=4)](https://github.com/RehanSaeed)

### [RehanSaeed](https://github.com/RehanSaeed)

Owner

9 June 2021

[@oising](https://github.com/oising) [@m-meier](https://github.com/m-meier) You need the latest version of the template installed for it to be displayed. Can you check that you have the latest installed by running:

```
dotnet new --update-check
dotnet new --update-apply
```

Alternatively:

```
dotnet new --uninstall Boxed.Templates
dotnet new --install Boxed.Templates
```

[![m-meier](https://avatars.githubusercontent.com/u/370149?v=4)](https://github.com/m-meier)

### [m-meier](https://github.com/m-meier)

9 June 2021 (edited 9 June 2021)

I already had 6.3.3. I tried reinstalling (and even a system reboot), but nothing worked.

```
PS U:\> dotnet new --update-check
All template packages are up-to-date.
PS U:\> dotnet new --uninstall Boxed.Templates
Success: Boxed.Templates::6.3.3 was uninstalled.
PS U:\> dotnet new --install Boxed.Templates
The following template packages will be installed:
  Boxed.Templates

Success: Boxed.Templates::6.3.3 installed the following templates:
Template Name               Short Name     Language  Tags
--------------------------  -------------  --------  ----------------------------
ASP.NET Core API Boxed      api            [C#]      .NET Boxed/Cloud/Service/Web
ASP.NET Core GraphQL Boxed  graphql        [C#]      .NET Boxed/Cloud/Service/Web
ASP.NET Core Orleans Boxed  orleans        [C#]      .NET Boxed/Cloud/Service/Web
NuGet Package Boxed         nuget          [C#]      .NET Boxed/Library
```

[![RehanSaeed](https://avatars.githubusercontent.com/u/2270364?v=4)](https://github.com/RehanSaeed)

### [RehanSaeed](https://github.com/RehanSaeed)

Owner

9 June 2021

[@sayedihashimi](https://github.com/sayedihashimi) Can we expect `dotnet new` templates to work in VS 16.11 preview? If you have 16.11 preview installed, can we expect 16.10 to still work?

[![mike1880](https://avatars.githubusercontent.com/u/17103824?v=4)](https://github.com/mike1880)

### [mike1880](https://github.com/mike1880)

9 June 2021

I still don't get the templates appearing in 16.10, only in 16.11. I can generate a solution in 16.11 but it won't build. The projects are generated as .Net 5.0 but it looks to be referencing .Net 6.0 in build; there are around 70 or so CS8032 errors, for example: "An instance of analyzer Microsoft.CodeAnalysis.MakeFieldReadonly.MakeFieldReadonlyDiagnosticAnalyzer cannot be created from C:\\Program Files\\dotnet\\sdk\\6.0.100-preview.4.21255.9\\Sdks\\Microsoft.NET.Sdk\\codestyle\\cs\\Microsoft.CodeAnalysis.CodeStyle.dll : Could not load file or assembly 'Microsoft.CodeAnalysis, Version=4.0.0.0, Culture=neutral, {app name} PublicKeyToken={value}' or one of its dependencies. The system cannot find the file specified.."

[![RehanSaeed](https://avatars.githubusercontent.com/u/2270364?v=4)](https://github.com/RehanSaeed)

### [RehanSaeed](https://github.com/RehanSaeed)

Owner

9 June 2021

Thanks [@mike1880](https://github.com/mike1880).

[@sayedihashimi](https://github.com/sayedihashimi) Is there some way I can stop VS 16.11 retargeting the TFM to .Net 6.0?

[![m-meier](https://avatars.githubusercontent.com/u/370149?v=4)](https://github.com/m-meier)

### [m-meier](https://github.com/m-meier)

9 June 2021

[@RehanSaeed](https://github.com/RehanSaeed): Now the templates appear for me. I added a visual studio feature (IIS debugging), afterwards the templates were available. I guess the installation cleared some cache or something similar.

I got the solution running on kestrel with 16.11 by switching the build target to 6.0, disabling build time code analysis and fixing an error from a non-nullable reference type and access to ActionContext (derefence from a possible null reference).

[![sayedihashimi](https://avatars.githubusercontent.com/u/1283154?v=4)](https://github.com/sayedihashimi)

### [sayedihashimi](https://github.com/sayedihashimi)

15 June 2021

[@RehanSaeed](https://github.com/RehanSaeed)

> [@sayedihashimi](https://github.com/sayedihashimi) Is there some way I can stop VS 16.11 retargeting the TFM to .Net 6.0?

Can you explain more what you are seeing? Are you saying that the user selected .NET 5 as the TFM and then VS used .net 6 instead?

```json
{"@context":"https://schema.org","@graph":[{"@id":"https://rehansaeed.com/#website","@type":"WebSite","description":"Software Developer at Microsoft, YouTuber, Open Source Contributor and Blogger","inLanguage":"en-GB","name":"Muhammad Rehan Saeed","url":"https://rehansaeed.com/","author":{"@id":"https://rehansaeed.com/#identity"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://rehansaeed.com/?search={search_term_string}"},"query-input":"required name=search_term_string"}],"publisher":{"@id":"https://rehansaeed.com/#publisher"}},{"@id":"https://rehansaeed.com/dotnet-boxed-visual-studio-integration/#webpage","@type":"WebPage","dateModified":"2021-05-27T11:00:00+00:00","datePublished":"2021-05-27T11:00:00+00:00","description":"You can now create .NET Boxed projects directly from Visual Studio. Here's a short post showing you how.","name":".NET Boxed Visual Studio Integration","url":"https://rehansaeed.com/dotnet-boxed-visual-studio-integration/","breadcrumb":{"@id":"https://rehansaeed.com/dotnet-boxed-visual-studio-integration/#breadcrumb"},"isPartOf":{"@id":"https://rehansaeed.com/#website"},"potentialAction":[{"@type":"ReadAction","target":["https://rehansaeed.com/dotnet-boxed-visual-studio-integration/"]}]},{"@id":"https://rehansaeed.com/#identity","@type":"Person","name":"Muhammad Rehan Saeed","url":"https://rehansaeed.com/about/","image":{"@id":"https://rehansaeed.com/#/schema/image/1"},"sameAs":["https://github.com/RehanSaeed","https://www.linkedin.com/in/muhammad-rehan-saeed","https://stackoverflow.com/users/1212017/muhammad-rehan-saeed","https://www.youtube.com/c/MuhammadRehanSaeed","https://www.twitch.tv/rehansaeeduk"]},{"@id":"https://rehansaeed.com/#publisher","@type":"Organization","logo":"https://rehansaeed.com/images/schema/Publisher-600x60.png","name":"Muhammad Rehan Saeed","url":"https://rehansaeed.com"},{"@id":"https://rehansaeed.com/dotnet-boxed-visual-studio-integration/#article","@type":"Article","dateModified":"2021-05-27T11:00:00+00:00","datePublished":"2021-05-27T11:00:00+00:00","description":"You can now create .NET Boxed projects directly from Visual Studio. Here's a short post showing you how.","headline":".NET Boxed Visual Studio Integration","inLanguage":"en-GB","url":"https://rehansaeed.com/dotnet-boxed-visual-studio-integration/","author":{"@id":"https://rehansaeed.com/#identity"},"image":[{"@type":"ImageObject","url":"https://rehansaeed.com/images/hero/Visual-Studio-1366x768.png","caption":"Visual Studio","width":"1366","height":"768"}],"isPartOf":{"@id":"https://rehansaeed.com/dotnet-boxed-visual-studio-integration/#webpage"},"keywords":[".NET Boxed","C#",".NET","ASP.NET"],"mainEntityOfPage":{"@id":"https://rehansaeed.com/dotnet-boxed-visual-studio-integration/#webpage"},"publisher":{"@id":"https://rehansaeed.com/#publisher"}},{"@id":"https://rehansaeed.com/dotnet-boxed-visual-studio-integration/#breadcrumb","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","name":"Blog","item":"https://rehansaeed.com/","position":1},{"@type":"ListItem","name":".NET Boxed Visual Studio Integration","item":"https://rehansaeed.com/dotnet-boxed-visual-studio-integration/","position":2}]},{"@id":"https://rehansaeed.com/#/schema/image/1","@type":"ImageObject","contentUrl":"https://rehansaeed.com/images/author/Muhammad-Rehan-Saeed/Logo-512x512.png","inLanguage":"en-GB","url":"https://rehansaeed.com/images/author/Muhammad-Rehan-Saeed/Logo-512x512.png"}]}
```

## Sitemap

See the full [sitemap](https://rehansaeed.com/sitemap.md) for all pages.
