ardalis / CleanArchitecture

Clean Architecture Solution Template: A starting point for Clean Architecture with ASP.NET Core
MIT License
15.28k stars 2.67k forks source link

Add support for Visual Studio 2022 #287

Open monkalways opened 2 years ago

monkalways commented 2 years ago
ardalis commented 2 years ago

Can you provide more details? I've been working with it in VS2022 for months now...

monkalways commented 2 years ago

Can you provide more details? I've been working with it in VS2022 for months now...

The template page (https://marketplace.visualstudio.com/items?itemName=GregTrevellick.CleanArchitecture) indicates it only works with VS2017 and VS2019. I tried to install the template onto VS2022, but got the following error from the installation log:

2021-12-01 8:05:28 PM - Microsoft VSIX Installer 2021-12-01 8:05:28 PM - ------------------------------------------- 2021-12-01 8:05:28 PM - vsixinstaller.exe version: 2021-12-01 8:05:28 PM - 17.0.5226-preview5 2021-12-01 8:05:28 PM - ------------------------------------------- 2021-12-01 8:05:28 PM - Command line parameters: 2021-12-01 8:05:28 PM - C:\Program Files (x86)\Microsoft Visual Studio\Installer\resources\app\ServiceHub\Services\Microsoft.VisualStudio.Setup.Service\VSIXInstaller.exe,D:\Chrome_Downloads\vsixTemplatePackSideWaffle (1).vsix 2021-12-01 8:05:28 PM - ------------------------------------------- 2021-12-01 8:05:28 PM - Microsoft VSIX Installer 2021-12-01 8:05:28 PM - ------------------------------------------- 2021-12-01 8:05:28 PM - Initializing Install... 2021-12-01 8:05:29 PM - Extension Details... 2021-12-01 8:05:29 PM - Identifier : 3D68A845-300E-4D15-8EAA-28F9B51DB6BC 2021-12-01 8:05:29 PM - Name : Clean Architecture 2021-12-01 8:05:29 PM - Author : Greg Trevellick 2021-12-01 8:05:29 PM - Version : 1.0.22 2021-12-01 8:05:29 PM - Description : A template for a solution structure that can be used to build Domain-Driven Design (DDD)-based or simply well-factored, SOLID applications using .NET Core. 2021-12-01 8:05:29 PM - Locale : en-US 2021-12-01 8:05:29 PM - MoreInfoURL : https://github.com/GregTrevellick/CleanArchitecture 2021-12-01 8:05:29 PM - InstalledByMSI : False 2021-12-01 8:05:29 PM - SupportedFrameworkVersionRange : [4.5,) 2021-12-01 8:05:29 PM - 2021-12-01 8:05:29 PM - SignatureState : Unsigned 2021-12-01 8:05:29 PM - Supported Products : 2021-12-01 8:05:29 PM - Microsoft.VisualStudio.Community 2021-12-01 8:05:29 PM - Version : [15.0,17.0) 2021-12-01 8:05:29 PM - ProductArchitecture : x86 2021-12-01 8:05:29 PM - 2021-12-01 8:05:29 PM - References : 2021-12-01 8:05:29 PM - Prerequisites : 2021-12-01 8:05:29 PM - ------------------------------------------------------- 2021-12-01 8:05:29 PM - Identifier : Microsoft.VisualStudio.Component.CoreEditor 2021-12-01 8:05:29 PM - Name : Visual Studio core editor 2021-12-01 8:05:29 PM - Version : [15.0,) 2021-12-01 8:05:29 PM - 2021-12-01 8:05:29 PM - Signature Details... 2021-12-01 8:05:29 PM - Extension is not signed. 2021-12-01 8:05:29 PM - 2021-12-01 8:05:29 PM - Searching for applicable products... 2021-12-01 8:05:29 PM - Found installed product - Global Location 2021-12-01 8:05:29 PM - Found installed product - Visual Studio Enterprise 2022 2021-12-01 8:05:29 PM - VSIXInstaller.NoApplicableSKUsException: This extension is not installable on any currently installed products. at VSIXInstaller.ExtensionService.GetInstallableDataImpl(IInstallableExtension extension, String extensionPackParentName, Boolean isRepairSupported, IStateData stateData, IEnumerable1& skuData) at VSIXInstaller.ExtensionService.GetInstallableData(String vsixPath, String extensionPackParentName, Boolean isRepairSupported, IStateData stateData, IEnumerable1& skuData) at VSIXInstaller.ExtensionPackService.IsExtensionPack(IStateData stateData, Boolean isRepairSupported) at VSIXInstaller.ExtensionPackService.ExpandExtensionPackToInstall(IStateData stateData, Boolean isRepairSupported) at VSIXInstaller.App.Initialize(Boolean isRepairSupported) at VSIXInstaller.App.Initialize() at System.Threading.Tasks.Task`1.InnerInvoke() at System.Threading.Tasks.Task.Execute() --- End of stack trace from previous location where exception was thrown --- at Microsoft.VisualStudio.Telemetry.WindowsErrorReporting.WatsonReport.GetClrWatsonExceptionInfo(Exception exceptionObject)

KamenRiderKuuga commented 2 years ago

Just install the template using dotnet new:

dotnet new -i Ardalis.CleanArchitecture.Template
dotnet new clean-arch -o Your.ProjectName
Uchiha-Peng commented 2 years ago

2022/2/23 10:40:38 - Microsoft VSIX Installer 2022/2/23 10:40:38 - ------------------------------------------- 2022/2/23 10:40:38 - vsixinstaller.exe version: 2022/2/23 10:40:38 - 17.1.1035-preview2 2022/2/23 10:40:38 - ------------------------------------------- 2022/2/23 10:40:38 - Command line parameters: 2022/2/23 10:40:38 - C:\Program Files (x86)\Microsoft Visual Studio\Installer\resources\app\ServiceHub\Services\Microsoft.VisualStudio.Setup.Service\VSIXInstaller.exe,D:\PC\Downloads\vsixTemplatePackSideWaffle.vsix 2022/2/23 10:40:38 - ------------------------------------------- 2022/2/23 10:40:38 - Microsoft VSIX Installer 2022/2/23 10:40:38 - ------------------------------------------- 2022/2/23 10:40:39 - Initializing Install... 2022/2/23 10:40:39 - 扩展详细信息... 2022/2/23 10:40:39 - Identifier : 3D68A845-300E-4D15-8EAA-28F9B51DB6BC 2022/2/23 10:40:39 - Name : Clean Architecture 2022/2/23 10:40:39 - Author : Greg Trevellick 2022/2/23 10:40:39 - Version : 1.0.22 2022/2/23 10:40:39 - Description : A template for a solution structure that can be used to build Domain-Driven Design (DDD)-based or simply well-factored, SOLID applications using .NET Core. 2022/2/23 10:40:39 - Locale : en-US 2022/2/23 10:40:39 - MoreInfoURL : https://github.com/GregTrevellick/CleanArchitecture 2022/2/23 10:40:39 - InstalledByMSI : False 2022/2/23 10:40:39 - SupportedFrameworkVersionRange : [4.5,) 2022/2/23 10:40:39 - 2022/2/23 10:40:39 - SignatureState : Unsigned 2022/2/23 10:40:39 - 支持的产品 : 2022/2/23 10:40:39 - Microsoft.VisualStudio.Community 2022/2/23 10:40:39 - Version : [15.0,17.0) 2022/2/23 10:40:39 - ProductArchitecture : x86 2022/2/23 10:40:39 - 2022/2/23 10:40:39 - 引用 : 2022/2/23 10:40:39 - 系统必备 : 2022/2/23 10:40:39 - ------------------------------------------------------- 2022/2/23 10:40:39 - Identifier : Microsoft.VisualStudio.Component.CoreEditor 2022/2/23 10:40:39 - Name : Visual Studio core editor 2022/2/23 10:40:39 - Version : [15.0,) 2022/2/23 10:40:39 - 2022/2/23 10:40:39 - 签名详细信息... 2022/2/23 10:40:39 - Extension is not signed. 2022/2/23 10:40:39 - 2022/2/23 10:40:39 - 正在搜索适用的产品... 2022/2/23 10:40:39 - 找到的已安装产品 - 全局位置 2022/2/23 10:40:39 - 找到的已安装产品 - Visual Studio Community 2022 Preview 2022/2/23 10:40:39 - VSIXInstaller.NoApplicableSKUsException: 此扩展不能安装在任何当前安装的产品上。 在 VSIXInstaller.ExtensionService.GetInstallableDataImpl(IInstallableExtension extension, String extensionPackParentName, Boolean isRepairSupported, IStateData stateData, IEnumerable1& skuData) 在 VSIXInstaller.ExtensionService.GetInstallableData(String vsixPath, String extensionPackParentName, Boolean isRepairSupported, IStateData stateData, IEnumerable1& skuData) 在 VSIXInstaller.ExtensionPackService.IsExtensionPack(IStateData stateData, Boolean isRepairSupported) 在 VSIXInstaller.ExtensionPackService.ExpandExtensionPackToInstall(IStateData stateData, Boolean isRepairSupported) 在 VSIXInstaller.App.Initialize(Boolean isRepairSupported) 在 VSIXInstaller.App.Initialize() 在 System.Threading.Tasks.Task`1.InnerInvoke() 在 System.Threading.Tasks.Task.Execute() --- 引发异常的上一位置中堆栈跟踪的末尾 --- 在 Microsoft.VisualStudio.Telemetry.WindowsErrorReporting.WatsonReport.GetClrWatsonExceptionInfo(Exception exceptionObject)

Uchiha-Peng commented 2 years ago

VS 2022 cannot be installed directly from vsixTemplatePackSideWaffle.vsix, but this command solved the problem nicely, thanks a lot.

Just install the template using dotnet new:

dotnet new -i Ardalis.CleanArchitecture.Template
dotnet new clean-arch -o Your.ProjectName

VS 2022 cannot be installed directly from vsixTemplatePackSideWaffle.vsix, but this command solved the problem nicely, thanks a lot.

MisinformedDNA commented 2 years ago

That extension, which is not published by @GregTrevellick, not @ardalis, is also over a year old. Better to use the CLI. I think @ardalis should publish his own or not link to the out-of-date extension.

moghimi commented 1 year ago

The template was installed using the CLI command with no error and works like a charm!

 dotnet new -i Ardalis.CleanArchitecture.Template

output:

The following template packages will be installed:
   Ardalis.CleanArchitecture.Template
Success: Ardalis.CleanArchitecture.Template::6.2.8 installed the following templates:
Template Name                        Short Name  Language  Tags
-----------------------------------  ----------  --------  ------------------------------
ASP.NET Clean Architecture Solution  clean-arch  [C#]      Web/ASP.NET/Clean Architecture

A sample project was created using this template : image

I think this issue should be closed.

Brutiquzz commented 1 year ago

When using the suggested CLI command then I receive the error that the package does not exist :(

I have tried with different version numbers also with no effect.

I am copy pasting directly from your example and from nuget.org so shouldn't be a typo

MisinformedDNA commented 1 year ago

@Brutiquzz Paste what you ran and the results.