dotnet-presentations / blazor-workshop

Blazor workshop
https://aka.ms/blazorworkshop
MIT License
3.51k stars 1.56k forks source link

.Net 5 version #302

Closed ja-iris closed 2 years ago

ja-iris commented 3 years ago

Can someone provide some notes in upgrading the project to .NET 5. Is there any plans to update the project?

Tried using the "Migrate from ASP.NET Core 3.1 to 5.0" page for guidance. https://docs.microsoft.com/en-us/aspnet/core/migration/31-to-50?view=aspnetcore-5.0&tabs=visual-studio It builds with the suggested change. Having problems with the SQLite database: Unhandled exception: SQLite Error 1: 'no such column: p.ConsumedTime'

tesar-tech commented 3 years ago

There is the 5.0 branch https://github.com/dotnet-presentations/blazor-workshop/tree/release/5.0

ja-iris commented 3 years ago

Thanks, I missed that branch coming from a link from somewhere else. I had to open it in full Visual Studio and update the nuget packages for it to work using "Manage NuGet packages for Solution". Presumably there's an equivalent way to do this in Visual Studio Code, or is there an extension people use for this?

ja-iris commented 3 years ago

(It was stage 08-templated-components where running the command created it as .Net 5 presumably could have added more parameters) dotnet new razorclasslib -o BlazingComponents dotnet sln add BlazingComponents

ja-iris commented 3 years ago

'Nuget Package Manager GUI' extension 'Update all Packages' options worked for me.

If I copy a save-points folder and then open that folder in Visual Studio Code, shouldn't it just work? If not I'll close this one.

lohithgn commented 3 years ago

Thanks, I missed that branch coming from a link from somewhere else. I had to open it in full Visual Studio and update the nuget packages for it to work using "Manage NuGet packages for Solution". Presumably there's an equivalent way to do this in Visual Studio Code, or is there an extension people use for this?

Hi. As far as i know - there is nothing of this sort for VS Code. But when you are using VSCode, you will need to do most of these kind of things from command line. Dotnet CLI supports a concept of global tool. There is an excellent tool called "dotnet-outdated". You can find it here: https://github.com/dotnet-outdated/dotnet-outdated. You install this as a global tool. Then go to the folder where the main SLN file is present and run the command "dotnet outdated". this command will scan all projects in the solution file and list if any package in any project is outdated. Here is a screenshot from when i ran on BlazinPizza src folder: image It also has an option to update the package automatically to latest available version. Do look in to the tools documentation.

Hope this helps

lohithgn commented 3 years ago

'Nuget Package Manager GUI' extension 'Update all Packages' options worked for me.

If I copy a save-points folder and then open that folder in Visual Studio Code, shouldn't it just work? If not I'll close this one.

Yes. Your understanding is correct.

lohithgn commented 2 years ago

@ja-iris we now have .NET6 and i believe @timheuer is working on upgrading the codebase to .NET 6. If this is no more an issue for you, do consider closing this issue. Thanks.

csharpfritz commented 2 years ago

I'm going through and updating the project to .NET 6 today.

csharpfritz commented 2 years ago

This will be superceded by #330

dotnetspark commented 2 years ago

Should this be closed then?

csharpfritz commented 2 years ago

Yes.. I’ll close it when the merge for .NET 6 is completed

Jeff

On Mar 16, 2022, at 11:45, Yadel Lopez @.***> wrote:

 Should this be closed then?

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.

surfmuggle commented 2 years ago

Using the save-point getting started i did run into problems. These issues

  1. library 'hostpolicy.dll' required to execute the application was not found - dotnet/sdk
  2. Could not find hostpolicy.dll - microsoft/vstest

might be related.

Because of the problems i switched to the folder src see below.

surfmuggle commented 2 years ago

In my attempt to use release 5 i did this

Errors

AuthenticationService.js:1

GET https://localhost:5001/_configuration/BlazingPizza.Client 404

and also

crit: Microsoft.AspNetCore.Components.WebAssembly.Rendering.WebAssemblyRenderer[100]
      Unhandled exception rendering component: Could not load settings from '_configuration/BlazingPizza.Client'
      Error: Could not load settings from '_configuration/BlazingPizza.Client'
          at Function.createUserManager 

and several errors from blazor.webassembly.js:1

crit: Microsoft.AspNetCore.Components.WebAssembly.Rendering.WebAssemblyRenderer[100]
      Unhandled exception rendering component: Could not load settings from '_configuration/BlazingPizza.Client'
      Error: Could not load settings from '_configuration/BlazingPizza.Client'
        at Function.createUserManager 

They point to the file AuthenticationService.js on different ports

https://localhost:5001/_content/Microsoft.AspNetCore.Components.WebAssembly.Authentication
              /AuthenticationService.js:1:5893
             /AuthenticationService.js:1:5027
csharpfritz commented 2 years ago

@surfmuggle I just cloned the repository and was able to compile and run the src/BlazingPizza.Server project with no code changes and no problems. Everything functions normally.

You should run the application from the BlazingPizza.Server project, as the application is hosted on the ASP.NET Core framework

dotnetspark commented 2 years ago

There is PR for upgrading to .NET 6 already. I would suggest to wait until it gets merged or -what I did- upgrade your copy. Also, .NET 5 support will be dropped on May, reason why I'm suggesting to use .NET 6

csharpfritz commented 2 years ago

@ylr-research - the PR has been merged, and I agree - migrate to .NET 6 for the long term support (LTS)

dotnetspark commented 2 years ago

Thanks for the update @csharpfritz. Let me refresh my copy. I think this issue can be closed.

surfmuggle commented 2 years ago

@csharpfritz Thanks for the hint. It now works. Regarding the end of support for version 5 in may 2022; our company is a little slow on the upgrade on new .NET version but luckily i found out today that 6.0 can now be used.