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

Unable to create a new app through Visual Studio #19475

Open
mrlacey opened this issue Feb 7, 2025 · 6 comments
Open

Unable to create a new app through Visual Studio #19475

mrlacey opened this issue Feb 7, 2025 · 6 comments
Labels
difficulty/tbd Categorizes an issue for which the difficulty level needs to be defined. kind/bug Something isn't working triage/untriaged Indicates an issue requires triaging or verification

Comments

@mrlacey
Copy link
Contributor

mrlacey commented Feb 7, 2025

Current behavior

I get the message 'Uno Platform projects require the "Place solution and project in the same directory" option to be checked in the previous window' when trying to create a new app through Visual Studio, even when that box is checked.

Screenshot showing the error even when the box is checked

Expected behavior

be able to create a new app

How to reproduce it (as minimally and precisely as possible)

  • Open Visual Studio
  • Try and create a new "Uno Platform App"
  • Use default name
  • With the box unchecked, click "Create"
  • Get the error message
  • Go back and check the box, click create again
  • Still get the error message

Also happens if don't have the box unchecked first :(

Workaround

use Avalonia?

Works on UWP/WinUI

None

Environment

Other

NuGet package version(s)

No response

Affected platforms

No response

IDE

Visual Studio 2022

IDE version

Version 17.13.0 Preview 5.0

Relevant plugins

VSIX version 5.6.15.19

Anything else we need to know?

The drive and directory trying to create the app in definitely exist and have all relevant permissions

@mrlacey mrlacey added difficulty/tbd Categorizes an issue for which the difficulty level needs to be defined. kind/bug Something isn't working triage/untriaged Indicates an issue requires triaging or verification labels Feb 7, 2025
@jeromelaban
Copy link
Member

Thanks for the report Matt! I'm not able to repro with preview 5... maybe VS changed once more the handling if this specific checkbox in mysterious ways :)

When this error happens, if you cancel then in the same instance, go to the Uno Platform output window, what do you see?

@jeromelaban jeromelaban added the triage/needs-information Indicates an issue needs more information in order to work on it. label Feb 7, 2025
@mrlacey
Copy link
Contributor Author

mrlacey commented Feb 8, 2025

All that is written to the output window is:

Uno Platform Template: Launching Uno Platform Wizard
Uno Platform Template: Error: Uno Platform projects require the "Place solution and project in the same directory" option to be checked in the previous window

@github-actions github-actions bot removed the triage/needs-information Indicates an issue needs more information in order to work on it. label Feb 8, 2025
@mrlacey
Copy link
Contributor Author

mrlacey commented Feb 8, 2025

After repeated attempts and repairing the WinUI workload, it started working again.
I wonder if it was detecting an issue with the missing workload but displayed the wrong error message...

@mrlacey
Copy link
Contributor Author

mrlacey commented Feb 8, 2025

After repeated attempts and repairing the WinUI workload, it started working again. I wonder if it was detecting an issue with the missing workload but displayed the wrong error message...

No, that's not it as another attempt to create a new project also failed with the same message.

I think there is something going wrong with detecting names of empty directories and how this is reported.

If I try and create a new app with the Project Name of "UnoApp1" in the Location: "D:\source\UnoApp1" this fails. (Note that this is an empty directory that does exist.)
If I try and create a new app with the Project Name of "UnoApp1" in the Location: "D:\source\MyApp" this works.

@jeromelaban
Copy link
Member

Indeed, this is related to the folder name.

We won't be able to support this scenario specifically, and the error message will become "The project name cannot match the destination folder name". This is causing the project to be placed inside another folder with the same name, which is not particularly useful.

@mrlacey
Copy link
Contributor Author

mrlacey commented Feb 12, 2025

Indeed, this is related to the folder name.

We won't be able to support this scenario specifically, and the error message will become "The project name cannot match the destination folder name". This is causing the project to be placed inside another folder with the same name, which is not particularly useful.

An error message that describes the actual issue is at least better than nothing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
difficulty/tbd Categorizes an issue for which the difficulty level needs to be defined. kind/bug Something isn't working triage/untriaged Indicates an issue requires triaging or verification
Projects
None yet
Development

No branches or pull requests

2 participants