Git Product home page Git Product logo

havitblazortemplate's Introduction

New Project Template - HAVIT Blazor Stack

Documentation

See the documentation (/doc/README.md).

Clonning template contents into new folder

If you have a local repository
git checkout-index --prefix=git-export-dir/ -a

Or create a new GitHub repository from template:
https://github.com/havit/NewProjectTemplate-Blazor/generate

Initial Setup

  1. SetupSolution.ps1 (replaces NewProjectTemplate with YourProjectName etc.)
    1. Open SetupSolution.ps1 and set parameters.
    2. Run SetupSolution.ps1.
    3. Delete SetupSolution.ps1
  2. Set Web.Server as the startup project.
  3. Adjust the Model - remove unnecessary entities (Country, Localizations, ...)
  4. Rebuild the solution
  5. Run DataLayer CodeGenerator (Run-CodeGenerator.ps1)
  6. Create an initial EF migration
    1. Drop the current migrations - delete Entity/Migrations folder
    2. Add new initial migration Add-Migration Initial
  7. Check all configuration files (including PublishScripts folder).
  8. Run the app...

Further Steps

  1. Update NuGet packages in solution.
  2. Application Insights - configure connection string

(Use PublishScripts folder for deployment settings.)

Upgrading existing project from net6 to net7

  1. Replace the <TargetFramework>net6.0</TargetFramework> to <TargetFramework>net7.0</TargetFramework> in all .csproj files.
  2. Update NuGet package references from 6.0.x to 7.0.x version + update other NuGet packages as needed.
  3. Build: Clean solution & Rebuild solution
  4. Deal with [Obsolete] APIs:
    1. Replace SignOutSessionStateManager (LoginDisplat.razor) with NavigationManager.NavigateToLogout(), see CS0618
  5. Deal with unsupported platform APIs
    1. In Web.Server/Program.cs, update the AddEventLog() call:
    if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
    {
    	logging.AddEventLog();
    }
  6. Deal with new code analyzer warnings, e.g.
    1. BL0007: Component parameter 'XY' should be auto property
      1. use @bind:after where applicable
      2. use #pragma warning disable where needed
  7. In dotnet-tools.json upgrade Havit.Data.EntityFrameworkCore.CodeGenerator.Tool to 2.7.0 version (net7) + try if the DataLayer/Run-CodeGenerator.ps1 runs currectly
  8. Check the TfsPublish.xml. There might be explicit net6 target, update it to net7.
  9. Update the Web.Server.csproj the EnsureWebJobInPackage target to use net7.0 in paths.
  10. If you use it, upgrade your GitHub workflow YAML to use net7.
  11. If you are hitting the "undefined" is not valid JSON when logging in, disable assembly trimming for Microsoft.AspNetCore.Components.WebAssembly.Authentication, see dotnet/aspnetcore#44981
  12. Remove the Blazor GC gRPC workaround when using facades (revert the Func<IXyFacade> usage to direct IXyFacade usage))

havitblazortemplate's People

Contributors

daleyoung avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.