Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

File -> New in IDE creates a .sln without the correct Deploy Configuration #2746

Closed
Redth opened this issue Sep 28, 2021 · 1 comment
Closed
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!

Comments

@Redth
Copy link
Member

Redth commented Sep 28, 2021

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.

"modifiers": [
{
  "condition": "(HostIdentifier == \"dotnetcli\")",
  "rename": [
     ".App.sln": ".sln"
  ]
}
@Redth Redth added the area-templates Project templates, Item Templates for Blazor and MAUI label Sep 28, 2021
@Redth Redth added this to the 6.0.101-preview.10 milestone Sep 28, 2021
mattleibow added a commit that referenced this issue Oct 4, 2021
Redth pushed a commit that referenced this issue Oct 4, 2021
@mattleibow
Copy link
Member

Fixed in #2823

@ghost ghost locked as resolved and limited conversation to collaborators Feb 18, 2022
@samhouts samhouts added the fixed-in-6.0.101-preview.10 Look for this fix in 6.0.101-preview.10! label Feb 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
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!
Projects
None yet
Development

No branches or pull requests

3 participants