{"id":2057,"date":"2021-05-15T13:58:15","date_gmt":"2021-05-15T13:58:15","guid":{"rendered":"https:\/\/sezeromer.com\/?p=2057"},"modified":"2023-03-04T13:42:06","modified_gmt":"2023-03-04T10:42:06","slug":"maui-ile-proje-olusturmak","status":"publish","type":"post","link":"https:\/\/sezeromer.com\/en\/maui-ile-proje-olusturmak\/","title":{"rendered":"How to Create Project With MAUI"},"content":{"rendered":"<p>Hello friends, in this article we will talk about how to create a project with MAUI. First of all, for those who ask what is MAUI, you can reach the Medium article I wrote before here.<\/p>\n<p>As it is known, MAUI will come with .Net 6. Preview versions are currently available. We will also create a MAUI project using these preview versions and see the differences with Xamarin. First of all, we need to install all the requirements for MAUI on our system. There is a very nice tool for this. With this tool, we can detect and install the necessary files in our system. You can find it here.<\/p>\n<p>To install this tool, you need to run the following command line.<\/p>\n<div class=\"wp-block-codemirror-blocks code-block \">\n<pre class=\"CodeMirror\" data-setting=\"{&quot;mode&quot;:&quot;swift&quot;,&quot;mime&quot;:&quot;text\/x-swift&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;lineNumbers&quot;:true,&quot;lineWrapping&quot;:false,&quot;styleActiveLine&quot;:true,&quot;readOnly&quot;:true,&quot;align&quot;:&quot;&quot;}\">dotnet tool install -g Redth.Net.Maui.Check<\/pre>\n<\/div>\n<p>Then you should run this command to check your system with this tool.<\/p>\n<div class=\"wp-block-codemirror-blocks code-block \">\n<pre class=\"CodeMirror\" data-setting=\"{&quot;mode&quot;:&quot;swift&quot;,&quot;mime&quot;:&quot;text\/x-swift&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;lineNumbers&quot;:true,&quot;lineWrapping&quot;:false,&quot;styleActiveLine&quot;:true,&quot;readOnly&quot;:true,&quot;align&quot;:&quot;&quot;}\">maui-check<\/pre>\n<\/div>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-2058\" src=\"https:\/\/sezeromer.com\/wp-content\/uploads\/2021\/05\/Screen-Shot-2021-05-15-at-16.27.20-1024x535.png\" alt=\"\" width=\"640\" height=\"334\" srcset=\"https:\/\/sezeromer.com\/wp-content\/uploads\/2021\/05\/Screen-Shot-2021-05-15-at-16.27.20-1024x535.png 1024w, https:\/\/sezeromer.com\/wp-content\/uploads\/2021\/05\/Screen-Shot-2021-05-15-at-16.27.20-300x157.png 300w, https:\/\/sezeromer.com\/wp-content\/uploads\/2021\/05\/Screen-Shot-2021-05-15-at-16.27.20-768x401.png 768w, https:\/\/sezeromer.com\/wp-content\/uploads\/2021\/05\/Screen-Shot-2021-05-15-at-16.27.20-500x261.png 500w, https:\/\/sezeromer.com\/wp-content\/uploads\/2021\/05\/Screen-Shot-2021-05-15-at-16.27.20-800x418.png 800w, https:\/\/sezeromer.com\/wp-content\/uploads\/2021\/05\/Screen-Shot-2021-05-15-at-16.27.20-1280x668.png 1280w, https:\/\/sezeromer.com\/wp-content\/uploads\/2021\/05\/Screen-Shot-2021-05-15-at-16.27.20.png 1327w\" sizes=\"(max-width: 640px) 100vw, 640px\" \/><\/p>\n<p>After making the necessary adjustments, you can create a new project. First of all, I will create a folder on my desktop and create it in this folder. We need to go into the folder I created from the terminal and then run the following command line.<\/p>\n<div class=\"wp-block-codemirror-blocks code-block \">\n<pre class=\"CodeMirror\" data-setting=\"{&quot;mode&quot;:&quot;swift&quot;,&quot;mime&quot;:&quot;text\/x-swift&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;lineNumbers&quot;:true,&quot;lineWrapping&quot;:false,&quot;styleActiveLine&quot;:true,&quot;readOnly&quot;:true,&quot;align&quot;:&quot;&quot;}\">dotnet new maui<\/pre>\n<\/div>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-2062\" src=\"https:\/\/sezeromer.com\/wp-content\/uploads\/2021\/05\/Screen-Shot-2021-05-15-at-16.32.51-1024x535.png\" alt=\"\" width=\"640\" height=\"334\" srcset=\"https:\/\/sezeromer.com\/wp-content\/uploads\/2021\/05\/Screen-Shot-2021-05-15-at-16.32.51-1024x535.png 1024w, https:\/\/sezeromer.com\/wp-content\/uploads\/2021\/05\/Screen-Shot-2021-05-15-at-16.32.51-300x157.png 300w, https:\/\/sezeromer.com\/wp-content\/uploads\/2021\/05\/Screen-Shot-2021-05-15-at-16.32.51-768x401.png 768w, https:\/\/sezeromer.com\/wp-content\/uploads\/2021\/05\/Screen-Shot-2021-05-15-at-16.32.51-500x261.png 500w, https:\/\/sezeromer.com\/wp-content\/uploads\/2021\/05\/Screen-Shot-2021-05-15-at-16.32.51-800x418.png 800w, https:\/\/sezeromer.com\/wp-content\/uploads\/2021\/05\/Screen-Shot-2021-05-15-at-16.32.51-1280x668.png 1280w, https:\/\/sezeromer.com\/wp-content\/uploads\/2021\/05\/Screen-Shot-2021-05-15-at-16.32.51.png 1327w\" sizes=\"(max-width: 640px) 100vw, 640px\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-2061\" src=\"https:\/\/sezeromer.com\/wp-content\/uploads\/2021\/05\/Screen-Shot-2021-05-15-at-16.32.57-1024x500.png\" alt=\"\" width=\"640\" height=\"313\" srcset=\"https:\/\/sezeromer.com\/wp-content\/uploads\/2021\/05\/Screen-Shot-2021-05-15-at-16.32.57-1024x500.png 1024w, https:\/\/sezeromer.com\/wp-content\/uploads\/2021\/05\/Screen-Shot-2021-05-15-at-16.32.57-300x147.png 300w, https:\/\/sezeromer.com\/wp-content\/uploads\/2021\/05\/Screen-Shot-2021-05-15-at-16.32.57-768x375.png 768w, https:\/\/sezeromer.com\/wp-content\/uploads\/2021\/05\/Screen-Shot-2021-05-15-at-16.32.57-500x244.png 500w, https:\/\/sezeromer.com\/wp-content\/uploads\/2021\/05\/Screen-Shot-2021-05-15-at-16.32.57-800x391.png 800w, https:\/\/sezeromer.com\/wp-content\/uploads\/2021\/05\/Screen-Shot-2021-05-15-at-16.32.57.png 1122w\" sizes=\"(max-width: 640px) 100vw, 640px\" \/><\/p>\n<p>Then you can open this folder with Visual Studio Code. If you try to build with this ali, it will give errors. To fix these errors, we need to add a nuget.config file to our project. With this file, our packages in the project can be restored. You need to add the following lines to the file we have created.<\/p>\n<div class=\"wp-block-codemirror-blocks code-block \">\n<pre class=\"CodeMirror\" data-setting=\"{&quot;mode&quot;:&quot;swift&quot;,&quot;mime&quot;:&quot;text\/x-swift&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;lineNumbers&quot;:true,&quot;lineWrapping&quot;:false,&quot;styleActiveLine&quot;:true,&quot;readOnly&quot;:true,&quot;align&quot;:&quot;&quot;}\">&lt;?xml version=\"1.0\" encoding=\"utf-8\"?&gt;\r\n&lt;configuration&gt;\r\n  &lt;packageSources&gt;\r\n    &lt;add key=\"dotnet6\" value=\"https:\/\/pkgs.dev.azure.com\/dnceng\/public\/_packaging\/dotnet6\/nuget\/v3\/index.json\" \/&gt;\r\n    &lt;add key=\"xamarin\" value=\"https:\/\/pkgs.dev.azure.com\/azure-public\/vside\/_packaging\/xamarin-impl\/nuget\/v3\/index.json\" \/&gt;\r\n  &lt;\/packageSources&gt;\r\n&lt;\/configuration&gt;<\/pre>\n<\/div>\n<p>Then we can run the project with the following command line in the terminal on Visual Studio Code. You can add whatever you want Android, iOS or Mac.<\/p>\n<div class=\"wp-block-codemirror-blocks code-block \">\n<pre class=\"CodeMirror\" data-setting=\"{&quot;mode&quot;:&quot;swift&quot;,&quot;mime&quot;:&quot;text\/x-swift&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;lineNumbers&quot;:true,&quot;lineWrapping&quot;:false,&quot;styleActiveLine&quot;:true,&quot;readOnly&quot;:true,&quot;align&quot;:&quot;&quot;}\">dotnet build -t:Run -f net6.0-android\r\ndotnet build -t:Run -f net6.0-ios\r\ndotnet build -t:Run -f net6.0-maccatalyst<\/pre>\n<\/div>\n<p>When the project is run, we encounter a screen like the one below.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2063\" src=\"https:\/\/sezeromer.com\/wp-content\/uploads\/2021\/05\/Screen-Shot-2021-05-15-at-16.47.59.png\" alt=\"\" width=\"730\" height=\"968\" srcset=\"https:\/\/sezeromer.com\/wp-content\/uploads\/2021\/05\/Screen-Shot-2021-05-15-at-16.47.59.png 730w, https:\/\/sezeromer.com\/wp-content\/uploads\/2021\/05\/Screen-Shot-2021-05-15-at-16.47.59-226x300.png 226w, https:\/\/sezeromer.com\/wp-content\/uploads\/2021\/05\/Screen-Shot-2021-05-15-at-16.47.59-500x663.png 500w\" sizes=\"(max-width: 730px) 100vw, 730px\" \/><\/p>\n<p>The project structure is as follows.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-2064\" src=\"https:\/\/sezeromer.com\/wp-content\/uploads\/2021\/05\/Screen-Shot-2021-05-15-at-16.48.26-1024x556.png\" alt=\"\" width=\"640\" height=\"348\" srcset=\"https:\/\/sezeromer.com\/wp-content\/uploads\/2021\/05\/Screen-Shot-2021-05-15-at-16.48.26-1024x556.png 1024w, https:\/\/sezeromer.com\/wp-content\/uploads\/2021\/05\/Screen-Shot-2021-05-15-at-16.48.26-300x163.png 300w, https:\/\/sezeromer.com\/wp-content\/uploads\/2021\/05\/Screen-Shot-2021-05-15-at-16.48.26-768x417.png 768w, https:\/\/sezeromer.com\/wp-content\/uploads\/2021\/05\/Screen-Shot-2021-05-15-at-16.48.26-1536x834.png 1536w, https:\/\/sezeromer.com\/wp-content\/uploads\/2021\/05\/Screen-Shot-2021-05-15-at-16.48.26-2048x1112.png 2048w, https:\/\/sezeromer.com\/wp-content\/uploads\/2021\/05\/Screen-Shot-2021-05-15-at-16.48.26-500x271.png 500w, https:\/\/sezeromer.com\/wp-content\/uploads\/2021\/05\/Screen-Shot-2021-05-15-at-16.48.26-800x434.png 800w, https:\/\/sezeromer.com\/wp-content\/uploads\/2021\/05\/Screen-Shot-2021-05-15-at-16.48.26-1280x695.png 1280w, https:\/\/sezeromer.com\/wp-content\/uploads\/2021\/05\/Screen-Shot-2021-05-15-at-16.48.26-1920x1042.png 1920w\" sizes=\"(max-width: 640px) 100vw, 640px\" \/><\/p>\n<p>If you have any questions, you can reach us by sending a mile or comment. Good works.<\/p>\n<p>&nbsp;<\/p>","protected":false},"excerpt":{"rendered":"<p>Hello friends, in this article we will talk about how to create a project with MAUI. First of all, for those who ask what is MAUI, you can reach the Medium article I wrote before here. As it is known, MAUI will come with .Net 6. Preview versions are currently available. We will also create [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":2065,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[289,804,1,288,803,802,3],"tags":[798,797,801,800,5,476,796,8,799,795,22],"class_list":["post-2057","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-android","category-maui-android","category-c-ile-ilgili-yazilar","category-ios","category-maui-ios","category-maui","category-xamarin-ile-yapilmis-projeler","tag-net-6","tag-maui","tag-maui-check","tag-maui-project","tag-microsoft","tag-mobile","tag-omeer-sezer","tag-omer","tag-preview","tag-sezere","tag-xamarin"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/sezeromer.com\/en\/wp-json\/wp\/v2\/posts\/2057"}],"collection":[{"href":"https:\/\/sezeromer.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sezeromer.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sezeromer.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sezeromer.com\/en\/wp-json\/wp\/v2\/comments?post=2057"}],"version-history":[{"count":8,"href":"https:\/\/sezeromer.com\/en\/wp-json\/wp\/v2\/posts\/2057\/revisions"}],"predecessor-version":[{"id":2670,"href":"https:\/\/sezeromer.com\/en\/wp-json\/wp\/v2\/posts\/2057\/revisions\/2670"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/sezeromer.com\/en\/wp-json\/wp\/v2\/media\/2065"}],"wp:attachment":[{"href":"https:\/\/sezeromer.com\/en\/wp-json\/wp\/v2\/media?parent=2057"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sezeromer.com\/en\/wp-json\/wp\/v2\/categories?post=2057"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sezeromer.com\/en\/wp-json\/wp\/v2\/tags?post=2057"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}