diff --git a/doc/articles/get-started-vsmac.md b/doc/articles/get-started-vsmac.md index 07e660828ed8..842ca37dc74e 100644 --- a/doc/articles/get-started-vsmac.md +++ b/doc/articles/get-started-vsmac.md @@ -12,54 +12,52 @@ While it is easier to create apps using Uno Platform on Windows, you can also cr * [**GTK+3**](https://formulae.brew.sh/formula/gtk+3) for running the Skia/GTK projects ## Installing the dotnet new templates -- In order to create a new Uno Project, you'll need to install the [`dotnet new` Uno Platform templates](get-started-dotnet-new.md). -- Once done, in Visual Studio for Mac, open the preference menu: - - On left side, open the **Other** then **Preview Features** menu - - Check the **Show all .NET Core templates in the New Project dialog** +In order to create a new Uno Project, you'll need to install the [`dotnet new` Uno Platform templates](get-started-dotnet-new.md). ## Create a new project using the IDE -1. To create a new project: - - Click the **New** button on the welcome screen - - Select **Cross Platform App (Uno Platform)** - - If presented with a list of options, uncheck **Skia/WPF** - - Choose a name then click create +1. To create a new project, from the command line: + ``` + cd src + dotnet new unoapp -o MyApp01 + ``` -1. Once created, you should see your folder structure set up like this: -![folder-structure](Assets/quick-start/vs-mac-folder-structure.png)\ +1. Once created, open the `MyApp-vsmac.slnf` file + - This `slnf` is called a solution filter, which automatically excludes projects which are not compatible with Visual Studio for mac. - If you have a warning symbol on your iOS project, make sure you have the minimum version of Xcode installed. ![update-xcode](Assets/quick-start/xcode-version-warning.jpg)\ + To update, go to `Visual Studio > Preferences > Projects > SDK Locations > Apple` and select Xcode 12 or higher. Restart Visual Studio. -1. If you did not get presented a list of options to create the project, as of Visual Studio for Mac 8.8, the Uno Platform template contains WPF projects that prevent NuGet restore to work properly. To fix this: - - Select the `MyProject.Skia.Wpf` and `MyProject.Skia.Wpf.Host` - - Right click to remove them from the solution. - - At the top of the tree, on the solution node, right click and select **Restore Nuget Packages** -1. You can now run on iOS, Android, and macOS by setting your startup project and running. -![startup-projects](Assets/quick-start/vs-mac-build.png) +1. You can now run on iOS, Android, macOS and Skia.GTK projects by changing your startup project and start the debugger. Note: You will not be able to build the UWP and WPF projects on a Mac. All changes to this project must be made on Windows. -## Create a new project using the command line +## Create a other projects types using the command line You can create a new Uno Platfom solution with the following terminal command: ```bash - dotnet new unoapp -o MyProject --skia-wpf=false + dotnet new unoapp -o MyProject --wasm=false ``` -Once created, you can open it using the Visual Studio IDE. +Once created, you can open it using the Visual Studio IDE. ### Build and Run for WebAssembly Building for WebAssembly takes a few more steps: 1. Set `MyProject.Wasm` to startup project -2. Build the project -3. In the terminal, navigate to your build output. This will typically be: `MyProject.Wasm > bin > Debug > netstandard2.0 > dist > server.py` Run the `server.py` program. -4. In your browser, open localhost:8000. +1. Build the project +1. In the terminal, navigate to your build output path. This will typically be: `MyProject.Wasm > bin > Debug > net5.0 > dist` +1. Install `dotnet serve`: + ``` + dotnet tool install -g dotnet-serve + ``` +1. Once installed type `dotnet serve`. +4. Navigate to the url presented by the tool to run your application ### Video Tutorial [![Getting Started Visual Studio Mac Video](Assets/vsmac-cover.JPG)](http://www.youtube.com/watch?v=ESGJr6kHQg0 "") ### Getting Help -If you have issues with Visual Studio and Uno Platform, please visit our [Discord](https://www.platform.uno/discord) - #uno-platform channel or [StackOverflow](https://stackoverflow.com/questions/tagged/uno-platform) where our engineering team and community will be able to help you. +If you have issues with Visual Studio and Uno Platform, please visit our [Discord](https://www.platform.uno/discord) - #uno-platform channel or [StackOverflow](https://stackoverflow.com/questions/tagged/uno-platform) where our engineering team and community will be able to help you. \ No newline at end of file diff --git a/src/SolutionTemplate/Uno.ProjectTemplates.Dotnet/Uno.ProjectTemplates.Dotnet.csproj b/src/SolutionTemplate/Uno.ProjectTemplates.Dotnet/Uno.ProjectTemplates.Dotnet.csproj index e526f3314673..5e84a24235ec 100644 --- a/src/SolutionTemplate/Uno.ProjectTemplates.Dotnet/Uno.ProjectTemplates.Dotnet.csproj +++ b/src/SolutionTemplate/Uno.ProjectTemplates.Dotnet/Uno.ProjectTemplates.Dotnet.csproj @@ -121,10 +121,28 @@ + + + + + + + + + + + content\unoapp + + + content\unoapp + + + content\unoapp + diff --git a/src/SolutionTemplate/Uno.ProjectTemplates.Dotnet/content/unoapp-net6/.vsconfig b/src/SolutionTemplate/Uno.ProjectTemplates.Dotnet/content/unoapp-net6/.vsconfig index 4f3dd1d44d7f..693d3f063965 100644 --- a/src/SolutionTemplate/Uno.ProjectTemplates.Dotnet/content/unoapp-net6/.vsconfig +++ b/src/SolutionTemplate/Uno.ProjectTemplates.Dotnet/content/unoapp-net6/.vsconfig @@ -83,7 +83,6 @@ "Microsoft.VisualStudio.Component.VC.Tools.ARM", "Microsoft.VisualStudio.ComponentGroup.UWP.VC", "Microsoft.VisualStudio.Workload.Universal", - "Microsoft.VisualStudio.ComponentGroup.Maui.All", "Component.OpenJDK", "Microsoft.VisualStudio.Component.MonoDebugger", "Microsoft.VisualStudio.Component.Merq", @@ -92,6 +91,7 @@ "Component.Xamarin", "Component.Android.SDK28", "Microsoft.VisualStudio.Workload.NetCrossPlat", - "Microsoft.VisualStudio.Workload.NetCoreTools" + "Microsoft.VisualStudio.Workload.NetCoreTools", + "Microsoft.VisualStudio.ComponentGroup.Maui.All", ] } diff --git a/src/SolutionTemplate/Uno.ProjectTemplates.Dotnet/content/unoapp-net6/UnoQuickStart-vsmac.slnf b/src/SolutionTemplate/Uno.ProjectTemplates.Dotnet/content/unoapp-net6/UnoQuickStart-vsmac.slnf new file mode 100644 index 000000000000..d3ae3162a717 --- /dev/null +++ b/src/SolutionTemplate/Uno.ProjectTemplates.Dotnet/content/unoapp-net6/UnoQuickStart-vsmac.slnf @@ -0,0 +1,24 @@ +{ + "solution": { + "path": "UnoQuickStart.sln", + "projects": [ + "UnoQuickStart.Shared\\UnoQuickStart.Shared.shproj", + + #//#if (Mobile) + "UnoQuickStart.Mobile\\UnoQuickStart.Mobile.csproj", + #//#endif + + #//#if (WebAssembly) + "UnoQuickStart.Wasm\\UnoQuickStart.Wasm.csproj", + #//#endif + + #//#if (skia-gtk) + "UnoQuickStart.Skia.Gtk\\UnoQuickStart.Skia.Gtk.csproj", + #//#endif + + #//#if (skia-linux-fb) + "UnoQuickStart.Skia.Linux.FrameBuffer\\UnoQuickStart.Skia.Linux.FrameBuffer.csproj", + #//#endif + ] + } +} diff --git a/src/SolutionTemplate/Uno.ProjectTemplates.Dotnet/content/unoapp-winui-net6/.vsconfig b/src/SolutionTemplate/Uno.ProjectTemplates.Dotnet/content/unoapp-winui-net6/.vsconfig index 99c343c05225..693d3f063965 100644 --- a/src/SolutionTemplate/Uno.ProjectTemplates.Dotnet/content/unoapp-winui-net6/.vsconfig +++ b/src/SolutionTemplate/Uno.ProjectTemplates.Dotnet/content/unoapp-winui-net6/.vsconfig @@ -6,15 +6,12 @@ "Microsoft.NetCore.Component.Runtime.3.1", "Microsoft.NetCore.Component.SDK", "Microsoft.VisualStudio.Component.NuGet", - "Microsoft.Net.Component.4.6.1.TargetingPack", "Microsoft.VisualStudio.Component.Roslyn.Compiler", "Microsoft.VisualStudio.Component.Roslyn.LanguageServices", "Microsoft.NetCore.Component.DevelopmentTools", "Microsoft.VisualStudio.ComponentGroup.WebToolsExtensions", "Microsoft.VisualStudio.Component.DockerTools", "Microsoft.NetCore.Component.Web", - "Microsoft.Net.Component.4.8.SDK", - "Microsoft.Net.Component.4.7.2.TargetingPack", "Microsoft.Net.ComponentGroup.DevelopmentPrerequisites", "Microsoft.VisualStudio.Component.TypeScript.4.0", "Microsoft.VisualStudio.Component.JavaScript.TypeScript", @@ -30,8 +27,6 @@ "Microsoft.VisualStudio.Component.MSODBC.SQL", "Microsoft.VisualStudio.Component.MSSQL.CMDLnUtils", "Microsoft.VisualStudio.Component.ManagedDesktop.Core", - "Microsoft.Net.Component.4.5.2.TargetingPack", - "Microsoft.Net.Component.4.5.TargetingPack", "Microsoft.VisualStudio.Component.SQL.SSDT", "Microsoft.VisualStudio.Component.SQL.DataSources", "Component.Microsoft.Web.LibraryManager", @@ -40,9 +35,6 @@ "Microsoft.VisualStudio.Component.IntelliCode", "Component.Microsoft.VisualStudio.LiveShare", "Microsoft.VisualStudio.ComponentGroup.Web.Client", - "Microsoft.Net.Component.4.TargetingPack", - "Microsoft.Net.Component.4.5.1.TargetingPack", - "Microsoft.Net.Component.4.6.TargetingPack", "Microsoft.Net.ComponentGroup.TargetingPacks.Common", "Component.Microsoft.VisualStudio.Web.AzureFunctions", "Microsoft.VisualStudio.ComponentGroup.AzureFunctions", @@ -58,9 +50,6 @@ "Microsoft.VisualStudio.Component.AppInsights.Tools", "Microsoft.VisualStudio.Component.WebDeploy", "Microsoft.VisualStudio.Component.Wcf.Tooling", - "Microsoft.Net.Component.4.6.2.TargetingPack", - "Microsoft.Net.Component.4.7.TargetingPack", - "Microsoft.Net.Component.4.7.1.TargetingPack", "Microsoft.VisualStudio.Workload.NetWeb", "Microsoft.VisualStudio.ComponentGroup.Azure.Prerequisites", "Microsoft.VisualStudio.Component.Azure.Waverton.BuildTools", @@ -103,10 +92,6 @@ "Component.Android.SDK28", "Microsoft.VisualStudio.Workload.NetCrossPlat", "Microsoft.VisualStudio.Workload.NetCoreTools", - "Microsoft.Net.Component.4.6.1.SDK", - "Microsoft.Net.Component.4.6.2.SDK", - "Microsoft.Net.Component.4.7.SDK", - "Microsoft.Net.Component.4.7.1.SDK", - "Microsoft.Net.Component.4.7.2.SDK" + "Microsoft.VisualStudio.ComponentGroup.Maui.All", ] } diff --git a/src/SolutionTemplate/Uno.ProjectTemplates.Dotnet/content/unoapp-winui-net6/UnoWinUIQuickStart-vsmac.slnf b/src/SolutionTemplate/Uno.ProjectTemplates.Dotnet/content/unoapp-winui-net6/UnoWinUIQuickStart-vsmac.slnf new file mode 100644 index 000000000000..4fcac8952761 --- /dev/null +++ b/src/SolutionTemplate/Uno.ProjectTemplates.Dotnet/content/unoapp-winui-net6/UnoWinUIQuickStart-vsmac.slnf @@ -0,0 +1,20 @@ +{ + "solution": { + "path": "UnoWinUIQuickStart.sln", + "projects": [ + "UnoWinUIQuickStart.Shared\\UnoWinUIQuickStart.Shared.shproj", + + #//#if (Mobile) + "UnoWinUIQuickStart.Mobile\\UnoWinUIQuickStart.Mobile.csproj", + #//#endif + + #//#if (WebAssembly) + "UnoWinUIQuickStart.Wasm\\UnoWinUIQuickStart.Wasm.csproj", + #//#endif + + #//#if (skia-gtk) + "UnoWinUIQuickStart.Skia.Gtk\\UnoWinUIQuickStart.Skia.Gtk.csproj", + #//#endif + ] + } +} diff --git a/src/SolutionTemplate/Uno.ProjectTemplates.Dotnet/content/unoapp-winui/UnoWinUIQuickStart-vsmac.slnf b/src/SolutionTemplate/Uno.ProjectTemplates.Dotnet/content/unoapp-winui/UnoWinUIQuickStart-vsmac.slnf new file mode 100644 index 000000000000..541b496bdcce --- /dev/null +++ b/src/SolutionTemplate/Uno.ProjectTemplates.Dotnet/content/unoapp-winui/UnoWinUIQuickStart-vsmac.slnf @@ -0,0 +1,28 @@ +{ + "solution": { + "path": "UnoWinUIQuickStart.sln", + "projects": [ + "UnoWinUIQuickStart.Shared\\UnoWinUIQuickStart.Shared.shproj", + + #//#if (Android) + "UnoWinUIQuickStart.Droid\\UnoWinUIQuickStart.Droid.csproj", + #//#endif + + #//#if (iOS) + "UnoWinUIQuickStart.iOS\\UnoWinUIQuickStart.iOS.csproj", + #//#endif + + #//#if (WebAssembly) + "UnoWinUIQuickStart.Wasm\\UnoWinUIQuickStart.Wasm.csproj", + #//#endif + + #//#if (macOS) + "UnoWinUIQuickStart.macOS\\UnoWinUIQuickStart.macOS.csproj", + #//#endif + + #//#if (skia-gtk) + "UnoWinUIQuickStart.Skia.Gtk\\UnoWinUIQuickStart.Skia.Gtk.csproj", + #//#endif + ] + } +} diff --git a/src/SolutionTemplate/Uno.ProjectTemplates.Dotnet/content/unoapp/UnoQuickStart-vsmac.slnf b/src/SolutionTemplate/Uno.ProjectTemplates.Dotnet/content/unoapp/UnoQuickStart-vsmac.slnf new file mode 100644 index 000000000000..0cf2b9a9eb1c --- /dev/null +++ b/src/SolutionTemplate/Uno.ProjectTemplates.Dotnet/content/unoapp/UnoQuickStart-vsmac.slnf @@ -0,0 +1,33 @@ +{ + "solution": { + "path": "UnoQuickStart.sln", + "projects": [ + "UnoQuickStart.Shared\\UnoQuickStart.Shared.shproj", + + #//#if (Android) + "UnoQuickStart.Droid\\UnoQuickStart.Droid.csproj", + #//#endif + + #//#if (iOS) + "UnoQuickStart.iOS\\UnoQuickStart.iOS.csproj", + #//#endif + + + #//#if (WebAssembly) + "UnoQuickStart.Wasm\\UnoQuickStart.Wasm.csproj", + #//#endif + + #//#if (macOS) + "UnoQuickStart.macOS\\UnoQuickStart.macOS.csproj", + #//#endif + + #//#if (skia-gtk) + "UnoQuickStart.Skia.Gtk\\UnoQuickStart.Skia.Gtk.csproj", + #//#endif + + #//#if (skia-linux-fb) + "UnoQuickStart.Skia.Linux.FrameBuffer\\UnoQuickStart.Skia.Linux.FrameBuffer.csproj", + #//#endif + ] + } +}