{"id":32696,"date":"2021-04-13T19:00:00","date_gmt":"2021-04-13T17:00:00","guid":{"rendered":"https:\/\/blexin.com\/uncategorized\/migrare-un-progetto-blazor-wasm-hosted-da-net-core-3-1-a-net-5\/"},"modified":"2021-05-28T09:46:57","modified_gmt":"2021-05-28T07:46:57","slug":"migrating-a-blazor-wasm-hosted-project-from-net-core-3-1-to-net-5","status":"publish","type":"post","link":"https:\/\/blexin.com\/en\/blog-en\/migrating-a-blazor-wasm-hosted-project-from-net-core-3-1-to-net-5\/","title":{"rendered":"Migrating a Blazor Wasm Hosted project from .NET Core 3.1 to .NET 5"},"content":{"rendered":"\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"608\" src=\"https:\/\/i0.wp.com\/blexin.com\/wp-content\/uploads\/2021\/04\/8_21_1105x656_blog-blazorwasm.png?resize=1024%2C608&#038;ssl=1\" alt=\"Blazor su .NET5\" class=\"wp-image-32666\" srcset=\"https:\/\/blexin.com\/wp-content\/uploads\/2021\/04\/8_21_1105x656_blog-blazorwasm-1024x608.png 1024w, https:\/\/blexin.com\/wp-content\/uploads\/2021\/04\/8_21_1105x656_blog-blazorwasm-980x582.png 980w, https:\/\/blexin.com\/wp-content\/uploads\/2021\/04\/8_21_1105x656_blog-blazorwasm-480x285.png 480w\" sizes=\"auto, (min-width: 0px) and (max-width: 480px) 480px, (min-width: 481px) and (max-width: 980px) 980px, (min-width: 981px) 1024px, 100vw\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">One of the goals of the <em>milestone<\/em> we are managing for one of our customers is the migration from .NET Core 3.1 to .NET 5. Let\u2019s see together the steps we have taken and analyze the corrective measures adopted to mitigate some breaking changes.&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The project in question is a Blazor Wasm application with a .NET designed backend. The Data Access Layer is realized with Entity Framework Core.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">1. Let&#8217;s&#8217; start from dependencies<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Nowadays there are no projects that do not have some dependence on one or more external libraries. We ensure that all the dependencies of our project are compatible with the new version of the framework. In this regard, remember that . NET 5 supports all libraries that support . NET Standard up to version 2.1. In our case, we had a few but fundamental dependencies all developed with . NET Standard 2.0 and then we started advantaged.&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The first piece of advice I share is to prefer, among the external libraries, those that implement .NET Standard with a good reputation and support.&nbsp;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">2. Update Blazor<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Once verified that all our dependencies would be usable even after the framework&#8217;s upgrade, we can start the update of the various projects. Let&#8217;s start with the backend project and make the following changes:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Update the global.json file with the new SDK version<\/li><\/ul>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\n{ \n  &quot;sdk&quot;: { \n\t&quot;version&quot;: &quot;5.0.102&quot; \n   } \n} \n<\/pre><\/div>\n\n\n<ul class=\"wp-block-list\"><li>Update the TargetFrameowrkof the project\u2019s file&nbsp;<\/li><\/ul>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\n&lt;PropertyGroup&gt; \n&lt;TargetFramework&gt;net5.0&lt;\/TargetFramework&gt; \n&lt;\/PropertyGroup&gt; \n<\/pre><\/div>\n\n\n<ul class=\"wp-block-list\"><li>Update Blazor Server packages<\/li><\/ul>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\n&lt;PackageReference Include=&quot;Microsoft.AspNetCore.Components.WebAssembly.Server&quot; Version=&quot;5.0.2&quot; \/&gt; \n<\/pre><\/div>\n\n\n<ul class=\"wp-block-list\"><li>Update all other dependencies to the version that supports the Framework . NET 5 excluding EF Core.&nbsp;<\/li><\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">The procedure is not particularly complex and does not present any criticisms.&nbsp;&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;Let\u2019s now move on to the frontend project (Blazor Web Assembly), where some small change is necessary but not complicated.&nbsp;&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The necessary steps to upgrade the Blazor front end are:&nbsp;<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Update the TargetFrameowrkof the project\u2019s file<\/li><\/ul>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\n&lt;PropertyGroup&gt; \n        &lt;TargetFramework&gt;net5.0&lt;\/TargetFramework&gt; \n&lt;\/PropertyGroup&gt;\n<\/pre><\/div>\n\n\n<ul class=\"wp-block-list\"><li>Update Blazor Client packages<\/li><\/ul>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\n&lt;PackageReference Include=&quot;Microsoft.AspNetCore.Components.WebAssembly&quot; Version=&quot;5.0.2&quot; \/&gt; \n&lt;PackageReference Include=&quot;Microsoft.AspNetCore.Components.WebAssembly.DevServer&quot; Version=&quot;5.0.2&quot; PrivateAssets=&quot;all&quot; \/&gt; \n &lt;PackageReference Include=&quot;Microsoft.Extensions.Http&quot; Version=&quot;5.0.0&quot; \/&gt;&lt;PackageReference Include=&quot;System.Net.Http.Json&quot; Version=&quot;5.0.0&quot; \/&gt; \n<\/pre><\/div>\n\n\n<ul class=\"wp-block-list\"><li>Modify index.html file<\/li><\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Remove<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\n&lt;app&gt;Loading...&lt;\/app&gt; \n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">Add<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\n&lt;div id=&quot;app&quot;&gt;Loading...&lt;\/div&gt; \n<\/pre><\/div>\n\n\n<ul class=\"wp-block-list\"><li>Modify App.razor file<\/li><\/ul>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\n&lt;Router AppAssembly=&quot;@typeof(Program).Assembly&quot; PreferExactMatches=&quot;@true&quot;&gt; \n<\/pre><\/div>\n\n\n<ul class=\"wp-block-list\"><li>Modify Program.cs file<\/li><\/ul>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nvar builder = WebAssemblyHostBuilder.CreateDefault(args); \nbuilder.RootComponents.Add&amp;lt;App&gt;(&quot;#app&quot;); \n<\/pre><\/div>\n\n\n<ul class=\"wp-block-list\"><li>Update all other dependencies to the version that supports the Framework . NET 5<\/li><\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Once the procedure is completed, our application is updated to the new version of the framework, and we can start using all the new features that the framework makes available to us. For more information on exceptional cases, you can take a look at the <a href=\"https:\/\/docs.microsoft.com\/en-us\/aspnet\/core\/migration\/31-to-50?view=aspnetcore-5.0&amp;tabs=visual-studio\" target=\"_blank\" rel=\"noreferrer noopener\">official guide<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">3. Update Entity Framework<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">To complete our project&#8217;s migration, we must now face a choice: continue to use Entity Framework in version 3.1 or complete the migration path with the upgrade to version 5.0 of EF Core?&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;It might seem a trivial choice: since we are updating the latest version of the framework, why not update the &#8220;Dependency&#8221; to the newest version?&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Given that Entity Framework Core is a . NET Standard 2.0 library since version 3.1, both versions are therefore supported in . NET 5. Unfortunately, however, Entity Framework Core 5.0 presents a series of changes to the LINQ provider for SQL Server (that we use in our project), which may impact our application both in terms of functionality and performance.&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Fortunately, our project is equipped with a good suite of tests and load tests, so we decide to upgrade Entity Framework Core to version 5.0.&nbsp;&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Technically being an external library, what we did was update the package version in the project file.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\n&lt;PackageReference Include=&quot;Microsoft.EntityFrameworkCore&quot; Version=&quot;5.0.2&quot; \/&gt; \n&lt;PackageReference Include=&quot;Microsoft.EntityFrameworkCore.SqlServer&quot; Version=&quot;5.0.2&quot; \/&gt; \n&lt;PackageReference Include=&quot;Microsoft.EntityFrameworkCore.Tools&quot; Version=&quot;5.0.2&quot;&gt; \n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">We launched the tests, and as expected, many of them did not pass. We didn\u2019t lose heart and went to analyze the various failed tests. We identified some critical issues due to the new version\u2019s <a href=\"https:\/\/docs.microsoft.com\/en-us\/ef\/core\/what-is-new\/ef-core-5.0\/breaking-changes\" target=\"_blank\" rel=\"noreferrer noopener\">breaking changes<\/a> to which we were prepared. Some undocumented ones that we discovered and faced along the way by doing good developers.&nbsp;One of the innovations introduced in Entity Framework Core 5 is the <strong>Split Queries<\/strong>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The LINQ to SQL provider converts LINQ queries into T-SQL code to run on the DBMS and maps the result of these queries to the entities defined in the context.&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Using the Split Queries option, the LINQ provider will generate small N queries for each Table involved using the Join as a filter on the linked tables. This way, both the data recovery phase from the DBMS and the subsequent mapping phase of the domain entities can be paralleled and optimized. A small example is taken from the documentation to understand the mechanism better.&nbsp;<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\nvar artists = context.Artists         \n        .Include(e =&gt; e.Albums)  \n        .ToList(); \n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">will generate the code T-SQL<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\nSELECT a.&quot;Id&quot;, a.&quot;Name&quot;, a0.&quot;Id&quot;, a0.&quot;ArtistId&quot;, a0.&quot;Title&quot; \nFROM &quot;Artists&quot; AS a \nLEFT JOIN &quot;Album&quot; AS a0 ON a.&quot;Id&quot; = a0.&quot;ArtistId&quot; \nORDER BY a.&quot;Id&quot;, a0.&quot;Id&quot; \n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">Instead<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\nvar artists = context.Artists \n        .Include(e =&gt; e.Albums) \n        .AsSplitQuery() \n        .ToList(); \n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">will generate the T-SQL code<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\nSELECT a.&quot;Id&quot;, a.&quot;Name&quot; \nFROM &quot;Artists&quot; AS a \nORDER BY a.&quot;Id&quot; \n  \nSELECT a0.&quot;Id&quot;, a0.&quot;ArtistId&quot;, a0.&quot;Title&quot;, a.&quot;Id&quot; \nFROM &quot;Artists&quot; AS a \nINNER JOIN &quot;Album&quot; AS a0 ON a.&quot;Id&quot; = a0.&quot;ArtistId&quot; \nORDER BY a.&quot;Id&quot; \n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">By default, the <em>split queries<\/em> is disabled, and you can use it individually on each query with the Assplitquery() method or globally in the &#8216;Onconfiguring (<a href=\"https:\/\/docs.microsoft.com\/en-us\/ef\/core\/querying\/single-split-queries\" target=\"_blank\" rel=\"noreferrer noopener\">documentation<\/a>).&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">It is also possible to enable a warning that at runtime signals queries that potentially could benefit from an increase in performance by enabling the Split Queries.&nbsp;<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nservices.AddDbContext&amp;lt;ItinerisDbContext&gt;(opt =&gt; \n        { \n                opt.UseSqlServer(Configuration.GetConnectionString(&quot;SqlServerConnectionString&quot;)); \n                opt.ConfigureWarnings(s =&gt; s.Log(RelationalEventId.MultipleCollectionIncludeWarning)); \n        }); \n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">Another novelty introduced in EF Core is the ability to filter the Include es:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\nvar blogs = context.Blogs \n    .Include(e =&gt; e.Posts.Where(p =&gt; p.Title.Contains(&quot;Cheese&quot;))) \n\t.ToList(); \n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">The two novelties we have just seen introduce an undocumented breaking change, which our tests have brought to light.&nbsp;&nbsp;Queries that produce projections on different collections with the <em>Select<\/em> instruction must also contain all the <em>Include <\/em>needed for the projection, otherwise, the properties of the linked collections will always be &#8220;null.&#8221;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">No problem, as we introduced the necessary <em>Include<\/em> the failed tests have finally passed.&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Once the problems highlighted by the unit tests have been resolved, we launch the load tests, and the results were not exactly up to expectations. In some cases, we found a performance degradation compared to version 3.1, even 50%<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"562\" height=\"485\" data-attachment-id=\"32688\" data-permalink=\"https:\/\/blexin.com\/en\/blog-en\/migrating-a-blazor-wasm-hosted-project-from-net-core-3-1-to-net-5\/attachment\/1-5-2\/\" data-orig-file=\"https:\/\/i0.wp.com\/blexin.com\/wp-content\/uploads\/2021\/04\/1.png?fit=562%2C485&amp;ssl=1\" data-orig-size=\"562,485\" data-comments-opened=\"0\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"1\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/blexin.com\/wp-content\/uploads\/2021\/04\/1.png?fit=300%2C259&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/blexin.com\/wp-content\/uploads\/2021\/04\/1.png?fit=562%2C485&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/blexin.com\/wp-content\/uploads\/2021\/04\/1.png?resize=562%2C485&#038;ssl=1\" alt=\"\" class=\"wp-image-32688\" srcset=\"https:\/\/blexin.com\/wp-content\/uploads\/2021\/04\/1.png 562w, https:\/\/blexin.com\/wp-content\/uploads\/2021\/04\/1-480x414.png 480w\" sizes=\"auto, (min-width: 0px) and (max-width: 480px) 480px, (min-width: 481px) 562px, 100vw\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">To make the tuning of queries, we use another novelty of Entity Framework Core 5: the log in the queries executed. Through this mechanism, we can analyze and optimize them.&nbsp;&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The log is enabled in the following way:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\nservices.AddDbContext&lt;ItinerisDbContext&gt;(opt =&gt; \n{ \n      \u2026 \n      opt.LogTo(l =&gt; Console.WriteLine(l)); \n}); \n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">Analyzing the warnings and the logs provided, we launched a tuning session of the code. Careful use of the split query and the use of specific methods that the SQL Server provider makes available (for example, Like() ) allow us to mitigate the decline in performance without reaching the previous version&#8217;s levels.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusions<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">In conclusion, while the upgrade to the new version in the framework has generated tangible benefits both in terms of performance and fresh features, EF Core&#8217;s upgrade was neither painless and fast nor free of imprecations.&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">I recommend the upgrade of EF Core in those projects where you have good coverage of unit tests to identify all the points to change automatically. If the project is not equipped with tests, arm yourself with such patience and pay particular attention to the methods you recover from the DB.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">See you in the next article<\/p>\n\n\n\n\n","protected":false},"excerpt":{"rendered":"<p>Some tricks to not go crazy while migrating <\/p>\n","protected":false},"author":196716252,"featured_media":32667,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_et_pb_use_builder":"off","_et_pb_old_content":"","_et_gb_content_width":"","_coblocks_attr":"","_coblocks_dimensions":"","_coblocks_responsive_height":"","_coblocks_accordion_ie_support":"","_crdt_document":"","inline_featured_image":false,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"_wpas_customize_per_network":false},"categories":[688637524],"tags":[688637421,688637542,688637416,688637460,688637384],"class_list":["post-32696","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blog-en","tag-net-en","tag-dotnetcore-en","tag-asp-net-core-en","tag-blazor-en","tag-c-en"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.2 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Migrating a Blazor Wasm Hosted project from .NET Core 3.1 to .NET 5 - Blexin<\/title>\n<meta name=\"description\" content=\"Each migration brings with it compatibility problems: let\u2019s see with Antonio how to pass a Blazor project to .NET5 without risk\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/blexin.com\/en\/blog-en\/migrating-a-blazor-wasm-hosted-project-from-net-core-3-1-to-net-5\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Migrating a Blazor Wasm Hosted project from .NET Core 3.1 to .NET 5 - Blexin\" \/>\n<meta property=\"og:description\" content=\"Each migration brings with it compatibility problems: let\u2019s see with Antonio how to pass a Blazor project to .NET5 without risk\" \/>\n<meta property=\"og:url\" content=\"https:\/\/blexin.com\/en\/blog-en\/migrating-a-blazor-wasm-hosted-project-from-net-core-3-1-to-net-5\/\" \/>\n<meta property=\"og:site_name\" content=\"Blexin\" \/>\n<meta property=\"article:published_time\" content=\"2021-04-13T17:00:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-05-28T07:46:57+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/i2.wp.com\/blexin.com\/wp-content\/uploads\/2021\/04\/8_21_1105x656_blog-blazorwasm.png?fit=1105%2C656&ssl=1\" \/>\n\t<meta property=\"og:image:width\" content=\"1105\" \/>\n\t<meta property=\"og:image:height\" content=\"656\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Antonio Venditti\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Antonio Venditti\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/blexin.com\/en\/blog-en\/migrating-a-blazor-wasm-hosted-project-from-net-core-3-1-to-net-5\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/blexin.com\/en\/blog-en\/migrating-a-blazor-wasm-hosted-project-from-net-core-3-1-to-net-5\/\"},\"author\":{\"name\":\"Antonio Venditti\",\"@id\":\"https:\/\/blexin.com\/en\/#\/schema\/person\/22c32a7a08e0ea5a2ff91b284e311b8e\"},\"headline\":\"Migrating a Blazor Wasm Hosted project from .NET Core 3.1 to .NET 5\",\"datePublished\":\"2021-04-13T17:00:00+00:00\",\"dateModified\":\"2021-05-28T07:46:57+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/blexin.com\/en\/blog-en\/migrating-a-blazor-wasm-hosted-project-from-net-core-3-1-to-net-5\/\"},\"wordCount\":1093,\"image\":{\"@id\":\"https:\/\/blexin.com\/en\/blog-en\/migrating-a-blazor-wasm-hosted-project-from-net-core-3-1-to-net-5\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/i0.wp.com\/blexin.com\/wp-content\/uploads\/2021\/04\/8_21_1105x656_blog-blazorwasm.png?fit=1105%2C656&ssl=1\",\"keywords\":[\".Net\",\".NetCore\",\"Asp.net core\",\"Blazor\",\"C#\"],\"articleSection\":[\"Blog\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/blexin.com\/en\/blog-en\/migrating-a-blazor-wasm-hosted-project-from-net-core-3-1-to-net-5\/\",\"url\":\"https:\/\/blexin.com\/en\/blog-en\/migrating-a-blazor-wasm-hosted-project-from-net-core-3-1-to-net-5\/\",\"name\":\"Migrating a Blazor Wasm Hosted project from .NET Core 3.1 to .NET 5 - Blexin\",\"isPartOf\":{\"@id\":\"https:\/\/blexin.com\/en\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/blexin.com\/en\/blog-en\/migrating-a-blazor-wasm-hosted-project-from-net-core-3-1-to-net-5\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/blexin.com\/en\/blog-en\/migrating-a-blazor-wasm-hosted-project-from-net-core-3-1-to-net-5\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/i0.wp.com\/blexin.com\/wp-content\/uploads\/2021\/04\/8_21_1105x656_blog-blazorwasm.png?fit=1105%2C656&ssl=1\",\"datePublished\":\"2021-04-13T17:00:00+00:00\",\"dateModified\":\"2021-05-28T07:46:57+00:00\",\"author\":{\"@id\":\"https:\/\/blexin.com\/en\/#\/schema\/person\/22c32a7a08e0ea5a2ff91b284e311b8e\"},\"description\":\"Each migration brings with it compatibility problems: let\u2019s see with Antonio how to pass a Blazor project to .NET5 without risk\",\"breadcrumb\":{\"@id\":\"https:\/\/blexin.com\/en\/blog-en\/migrating-a-blazor-wasm-hosted-project-from-net-core-3-1-to-net-5\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/blexin.com\/en\/blog-en\/migrating-a-blazor-wasm-hosted-project-from-net-core-3-1-to-net-5\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/blexin.com\/en\/blog-en\/migrating-a-blazor-wasm-hosted-project-from-net-core-3-1-to-net-5\/#primaryimage\",\"url\":\"https:\/\/i0.wp.com\/blexin.com\/wp-content\/uploads\/2021\/04\/8_21_1105x656_blog-blazorwasm.png?fit=1105%2C656&ssl=1\",\"contentUrl\":\"https:\/\/i0.wp.com\/blexin.com\/wp-content\/uploads\/2021\/04\/8_21_1105x656_blog-blazorwasm.png?fit=1105%2C656&ssl=1\",\"width\":1105,\"height\":656,\"caption\":\"Blazor su .NET5\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/blexin.com\/en\/blog-en\/migrating-a-blazor-wasm-hosted-project-from-net-core-3-1-to-net-5\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/blexin.com\/en\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Migrating a Blazor Wasm Hosted project from .NET Core 3.1 to .NET 5\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/blexin.com\/en\/#website\",\"url\":\"https:\/\/blexin.com\/en\/\",\"name\":\"Blexin\",\"description\":\"Con noi \u00e8 semplice\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/blexin.com\/en\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/blexin.com\/en\/#\/schema\/person\/22c32a7a08e0ea5a2ff91b284e311b8e\",\"name\":\"Antonio Venditti\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/secure.gravatar.com\/avatar\/3460007fe9323a859b603fbf3fe3b196d028ff22e53c85567b5a2b5cc2b022f5?s=96&d=identicon&r=g\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/3460007fe9323a859b603fbf3fe3b196d028ff22e53c85567b5a2b5cc2b022f5?s=96&d=identicon&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/3460007fe9323a859b603fbf3fe3b196d028ff22e53c85567b5a2b5cc2b022f5?s=96&d=identicon&r=g\",\"caption\":\"Antonio Venditti\"},\"url\":\"https:\/\/blexin.com\/en\/author\/antonio-vendittiblexin-com\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Migrating a Blazor Wasm Hosted project from .NET Core 3.1 to .NET 5 - Blexin","description":"Each migration brings with it compatibility problems: let\u2019s see with Antonio how to pass a Blazor project to .NET5 without risk","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/blexin.com\/en\/blog-en\/migrating-a-blazor-wasm-hosted-project-from-net-core-3-1-to-net-5\/","og_locale":"en_US","og_type":"article","og_title":"Migrating a Blazor Wasm Hosted project from .NET Core 3.1 to .NET 5 - Blexin","og_description":"Each migration brings with it compatibility problems: let\u2019s see with Antonio how to pass a Blazor project to .NET5 without risk","og_url":"https:\/\/blexin.com\/en\/blog-en\/migrating-a-blazor-wasm-hosted-project-from-net-core-3-1-to-net-5\/","og_site_name":"Blexin","article_published_time":"2021-04-13T17:00:00+00:00","article_modified_time":"2021-05-28T07:46:57+00:00","og_image":[{"width":1105,"height":656,"url":"https:\/\/i2.wp.com\/blexin.com\/wp-content\/uploads\/2021\/04\/8_21_1105x656_blog-blazorwasm.png?fit=1105%2C656&ssl=1","type":"image\/png"}],"author":"Antonio Venditti","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Antonio Venditti","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/blexin.com\/en\/blog-en\/migrating-a-blazor-wasm-hosted-project-from-net-core-3-1-to-net-5\/#article","isPartOf":{"@id":"https:\/\/blexin.com\/en\/blog-en\/migrating-a-blazor-wasm-hosted-project-from-net-core-3-1-to-net-5\/"},"author":{"name":"Antonio Venditti","@id":"https:\/\/blexin.com\/en\/#\/schema\/person\/22c32a7a08e0ea5a2ff91b284e311b8e"},"headline":"Migrating a Blazor Wasm Hosted project from .NET Core 3.1 to .NET 5","datePublished":"2021-04-13T17:00:00+00:00","dateModified":"2021-05-28T07:46:57+00:00","mainEntityOfPage":{"@id":"https:\/\/blexin.com\/en\/blog-en\/migrating-a-blazor-wasm-hosted-project-from-net-core-3-1-to-net-5\/"},"wordCount":1093,"image":{"@id":"https:\/\/blexin.com\/en\/blog-en\/migrating-a-blazor-wasm-hosted-project-from-net-core-3-1-to-net-5\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/blexin.com\/wp-content\/uploads\/2021\/04\/8_21_1105x656_blog-blazorwasm.png?fit=1105%2C656&ssl=1","keywords":[".Net",".NetCore","Asp.net core","Blazor","C#"],"articleSection":["Blog"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/blexin.com\/en\/blog-en\/migrating-a-blazor-wasm-hosted-project-from-net-core-3-1-to-net-5\/","url":"https:\/\/blexin.com\/en\/blog-en\/migrating-a-blazor-wasm-hosted-project-from-net-core-3-1-to-net-5\/","name":"Migrating a Blazor Wasm Hosted project from .NET Core 3.1 to .NET 5 - Blexin","isPartOf":{"@id":"https:\/\/blexin.com\/en\/#website"},"primaryImageOfPage":{"@id":"https:\/\/blexin.com\/en\/blog-en\/migrating-a-blazor-wasm-hosted-project-from-net-core-3-1-to-net-5\/#primaryimage"},"image":{"@id":"https:\/\/blexin.com\/en\/blog-en\/migrating-a-blazor-wasm-hosted-project-from-net-core-3-1-to-net-5\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/blexin.com\/wp-content\/uploads\/2021\/04\/8_21_1105x656_blog-blazorwasm.png?fit=1105%2C656&ssl=1","datePublished":"2021-04-13T17:00:00+00:00","dateModified":"2021-05-28T07:46:57+00:00","author":{"@id":"https:\/\/blexin.com\/en\/#\/schema\/person\/22c32a7a08e0ea5a2ff91b284e311b8e"},"description":"Each migration brings with it compatibility problems: let\u2019s see with Antonio how to pass a Blazor project to .NET5 without risk","breadcrumb":{"@id":"https:\/\/blexin.com\/en\/blog-en\/migrating-a-blazor-wasm-hosted-project-from-net-core-3-1-to-net-5\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/blexin.com\/en\/blog-en\/migrating-a-blazor-wasm-hosted-project-from-net-core-3-1-to-net-5\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/blexin.com\/en\/blog-en\/migrating-a-blazor-wasm-hosted-project-from-net-core-3-1-to-net-5\/#primaryimage","url":"https:\/\/i0.wp.com\/blexin.com\/wp-content\/uploads\/2021\/04\/8_21_1105x656_blog-blazorwasm.png?fit=1105%2C656&ssl=1","contentUrl":"https:\/\/i0.wp.com\/blexin.com\/wp-content\/uploads\/2021\/04\/8_21_1105x656_blog-blazorwasm.png?fit=1105%2C656&ssl=1","width":1105,"height":656,"caption":"Blazor su .NET5"},{"@type":"BreadcrumbList","@id":"https:\/\/blexin.com\/en\/blog-en\/migrating-a-blazor-wasm-hosted-project-from-net-core-3-1-to-net-5\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/blexin.com\/en\/"},{"@type":"ListItem","position":2,"name":"Migrating a Blazor Wasm Hosted project from .NET Core 3.1 to .NET 5"}]},{"@type":"WebSite","@id":"https:\/\/blexin.com\/en\/#website","url":"https:\/\/blexin.com\/en\/","name":"Blexin","description":"Con noi \u00e8 semplice","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/blexin.com\/en\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/blexin.com\/en\/#\/schema\/person\/22c32a7a08e0ea5a2ff91b284e311b8e","name":"Antonio Venditti","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/3460007fe9323a859b603fbf3fe3b196d028ff22e53c85567b5a2b5cc2b022f5?s=96&d=identicon&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/3460007fe9323a859b603fbf3fe3b196d028ff22e53c85567b5a2b5cc2b022f5?s=96&d=identicon&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/3460007fe9323a859b603fbf3fe3b196d028ff22e53c85567b5a2b5cc2b022f5?s=96&d=identicon&r=g","caption":"Antonio Venditti"},"url":"https:\/\/blexin.com\/en\/author\/antonio-vendittiblexin-com\/"}]}},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/blexin.com\/wp-content\/uploads\/2021\/04\/8_21_1105x656_blog-blazorwasm.png?fit=1105%2C656&ssl=1","jetpack_shortlink":"https:\/\/wp.me\/pcyUBx-8vm","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/blexin.com\/en\/wp-json\/wp\/v2\/posts\/32696","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blexin.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blexin.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blexin.com\/en\/wp-json\/wp\/v2\/users\/196716252"}],"replies":[{"embeddable":true,"href":"https:\/\/blexin.com\/en\/wp-json\/wp\/v2\/comments?post=32696"}],"version-history":[{"count":7,"href":"https:\/\/blexin.com\/en\/wp-json\/wp\/v2\/posts\/32696\/revisions"}],"predecessor-version":[{"id":33024,"href":"https:\/\/blexin.com\/en\/wp-json\/wp\/v2\/posts\/32696\/revisions\/33024"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blexin.com\/en\/wp-json\/wp\/v2\/media\/32667"}],"wp:attachment":[{"href":"https:\/\/blexin.com\/en\/wp-json\/wp\/v2\/media?parent=32696"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blexin.com\/en\/wp-json\/wp\/v2\/categories?post=32696"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blexin.com\/en\/wp-json\/wp\/v2\/tags?post=32696"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}