File -> New in IDE creates a .sln without the correct Deploy Configuration #2746
Labels
area-templates
Project templates, Item Templates for Blazor and MAUI
fixed-in-6.0.101-preview.10
Look for this fix in 6.0.101-preview.10!
Milestone
Phil's advice:
I think you need to remove the exclude for the sln file in template.json. When I suggested this, it wasn't apparent that you were doing anything special in the solution other then to work around an F5 issue. When you remove the exclude, I think you will still see an issue because the sln file included with the template is the same as the one being created by the Visual Studio. If you notice. The
sourceName
in your template.json is MauiApp.1 and you are naming your sln MauiApp.1.sln When this would get created in Visual Studio and you would type say MyMauiApp as the name of the project, VS will generate MyMauiApp.sln then because of the sourceName in the template.json, the template would generate MyMauiApp.csproj and MyMauiApp.sln, which conflicts with the Visual Studio generated sln.If you name your sln in the template as MauiApp.1.App.sln or something similar it would fix the problem. Sayed has some guidance and an example here
You could even reverse the condition on your modifier and do something like this.
This is assuming that you update the sln file in the template to be named as I mentioned. This way, dotnet new would still generate a Maui.1.sln, but VS would generate Maui.1.App.sln which would ensure it wouldn't conflict with the VS created SLN.
The text was updated successfully, but these errors were encountered: