You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I create a new MAUI project using the CLI and then create a solution file and add the project to the solution, then the Visual Studio Configuration Manager shows that the solution is only configured for Build (in both Debug and Release configurations), but it is not selected for Deploy.
This is a problem because as a result hitting "Run with Debugging" in VS for an android target (and I assume for an ios target, too) will not actually deploy and debug the project. Instead the build window shows:
2>------ Skipped Deploy: Project: maui2, Configuration: Debug Any CPU ------
2>Project not selected to build for this solution configuration
Manually right-clicking on the solution and checking the "Deploy" checkbox for the configuration(s) makes it work, but it is not obvious that is what is required.
Compare these two .sln files.
This is what you get from dotnet sln add:
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.31903.59
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "maui2", "maui2.csproj", "{3BE1E2A0-90E0-4D42-92B2-D7CDDA300CEE}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{3BE1E2A0-90E0-4D42-92B2-D7CDDA300CEE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3BE1E2A0-90E0-4D42-92B2-D7CDDA300CEE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3BE1E2A0-90E0-4D42-92B2-D7CDDA300CEE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3BE1E2A0-90E0-4D42-92B2-D7CDDA300CEE}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
And this is what you get if you click the 'Deploy' checkboxes:
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.31903.59
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "maui2", "maui2.csproj", "{3BE1E2A0-90E0-4D42-92B2-D7CDDA300CEE}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{3BE1E2A0-90E0-4D42-92B2-D7CDDA300CEE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3BE1E2A0-90E0-4D42-92B2-D7CDDA300CEE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3BE1E2A0-90E0-4D42-92B2-D7CDDA300CEE}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
{3BE1E2A0-90E0-4D42-92B2-D7CDDA300CEE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3BE1E2A0-90E0-4D42-92B2-D7CDDA300CEE}.Release|Any CPU.Build.0 = Release|Any CPU
{3BE1E2A0-90E0-4D42-92B2-D7CDDA300CEE}.Release|Any CPU.Deploy.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
To Reproduce
Install .NET 8.0 SDK or a .NET 9 Preview SDK
Install the MAUI workload
mkdir maui2 and cd maui2
dotnet new maui -f net8.0
dotnet new sln
dotnet sln maui2.sln add .\maui2.csproj
open the resulting project in Visual Studio 2022 (I have 17.11 Preview 3, but probably 17.10 has the same behavior)
select an appropriate x86-64 android emultator
hit F5 or click "Run with Debugging"
Observe the error from above
Right click on the solution and click "Configuration Manager" and check the "Deploy" checkboxes
Microsoft Visual Studio Enterprise 2022
Version 17.11.0 Preview 3.0
VisualStudio.17.Preview/17.11.0-pre.3.0+35103.136
Microsoft .NET Framework
Version 4.8.09032
Installed Version: Enterprise
Visual C++ 2022
Microsoft Visual C++ 2022
ASP.NET and Web Tools 17.11.227.26177
ASP.NET and Web Tools
Azure App Service Tools v3.0.0 17.11.227.26177
Azure App Service Tools v3.0.0
Azure Functions and Web Jobs Tools 17.11.227.26177
Azure Functions and Web Jobs Tools
C# Tools 4.11.0-3.24329.1+92051d4c24bc13ff58232104a647910bf22cd105
C# components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.
Common Azure Tools 1.10
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.
Extensibility Message Bus 1.4.39 (main@e8108eb)
Provides common messaging-based MEF services for loosely coupled Visual Studio extension components communication and integration.
GitHub Copilot 0.2.1586.52275
GitHub Copilot is an AI pair programmer that helps you write code faster and with less work.
Microsoft Azure Tools for Visual Studio 2.9
Support for Azure Cloud Services projects
Microsoft JVM Debugger 1.0
Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines
Mono Debugging for Visual Studio 17.11.3 (ba13144)
Support for debugging Mono processes with Visual Studio.
NuGet Package Manager 6.11.0
NuGet Package Manager in Visual Studio. For more information about NuGet, visit https://docs.nuget.org/
Razor (ASP.NET Core) 17.11.3.2432707+ea83da42ade2a5e193507d780559d79f0cb16c75
Provides languages services for ASP.NET Core Razor.
SQL Server Data Tools 17.11.38.0
Microsoft SQL Server Data Tools
Test Adapter for Boost.Test 1.0
Enables Visual Studio's testing tools with unit tests written for Boost.Test. The use terms and Third Party Notices are available in the extension installation directory.
Test Adapter for Google Test 1.0
Enables Visual Studio's testing tools with unit tests written for Google Test. The use terms and Third Party Notices are available in the extension installation directory.
TypeScript Tools 17.0.30625.2001
TypeScript Tools for Microsoft Visual Studio
Visual Basic Tools 4.11.0-3.24329.1+92051d4c24bc13ff58232104a647910bf22cd105
Visual Basic components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.
Visual F# Tools 17.11.0-beta.24317.3+c07c8ebad62f6629b36349381991a299598a8d74
Microsoft Visual F# Tools
Visual Studio IntelliCode 2.2
AI-assisted development for Visual Studio.
VisualStudio.DeviceLog 1.0
Information about my package
VisualStudio.Mac 1.0
Mac Extension for Visual Studio
VSPackage Extension 1.0
VSPackage Visual Studio Extension Detailed Info
Xamarin 17.11.0.86 (main@9d38808)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.
Xamarin Designer 17.11.3.10 (remotes/origin/d17-11@714146c62b)
Visual Studio extension to enable Xamarin Designer tools in Visual Studio.
Xamarin.Android SDK 13.2.2.0 (d17-5/45b0e14)
Xamarin.Android Reference Assemblies and MSBuild support.
Mono: d9a6e87
Java.Interop: xamarin/java.interop/d17-5@149d70fe
SQLite: xamarin/sqlite/3.40.1@68c69d8
Xamarin.Android Tools: xamarin/xamarin-android-tools/d17-5@ca1552d
The text was updated successfully, but these errors were encountered:
Checking if this affects the .NET MAUI extension in VS Code. They don't have a Configuration Manager UI and I think VS Code users are much more likely to use the CLI
Nope .NET MAUI extension in VS Code doesn't seem to care about "Deploy". So it's just VS 2022 that's affected
To preface, I don't really know anything about MAUI, but from my understanding of this issue, there doesn't seem to be a problem here (meaning that both tools, dotnet CLI and VS, are working as intended).
dotnet sln add will only ever add the project with the default Debug and Release configurations. There's not a mechanism for it to be aware of other configurations.
Visual Studio has a vastly different understanding of the "state of a solution", so it might have some kind of logic for MAUI projects to be aware that a Deploy configuration would exist. There's nothing of that sort of contextual awareness in the dotnet CLI. As you mentioned, you needed to add the at configuration to the project using the VS Configuration Manager, which is the intended use-case for that dialog.
If you still think there is an issue, I'd recommend filing something over in https://github.com/dotnet/maui and mention this issue there so they can have some context/understanding.
Describe the bug
If I create a new MAUI project using the CLI and then create a solution file and add the project to the solution, then the Visual Studio Configuration Manager shows that the solution is only configured for Build (in both Debug and Release configurations), but it is not selected for Deploy.
This is a problem because as a result hitting "Run with Debugging" in VS for an android target (and I assume for an ios target, too) will not actually deploy and debug the project. Instead the build window shows:
Manually right-clicking on the solution and checking the "Deploy" checkbox for the configuration(s) makes it work, but it is not obvious that is what is required.
Compare these two
.sln
files.This is what you get from
dotnet sln add
:And this is what you get if you click the 'Deploy' checkboxes:
To Reproduce
mkdir maui2
andcd maui2
dotnet new maui -f net8.0
dotnet new sln
dotnet sln maui2.sln add .\maui2.csproj
Exceptions (if any)
Further technical details
Visual Studio:
The text was updated successfully, but these errors were encountered: