locked
How to upgrade razor crud proj from 2.1 to 2.2.4 RRS feed

  • Question

  • User915516305 posted

    Hi,

    noticed ef core for oracle now in production and started to try and upgrade ef core oracle beta to prod

     

    ran below but got message about 2.2.4

     

    dotnet add package Oracle.EntityFrameworkCore --version 2.19.30

     

    How can we best upgrade?

     

    How do we move from 2.1 netcoreapp2.1 to 2.2.4?

    get message 

    C:\Program Files\dotnet\sdk\2.1.403\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.TargetFrameworkInference.targets(137,5): error NETSDK1045: The current .NET SDK does not support targeting .NET Core 2.2. Either target .NET Core 2.1 or lower, or use a version of the .NET SDK that supports .NET Core 2.2. [D:\RazorCRUD\RazorCRUD.csproj]

     

     if simply try change .csproj file from 2.1 to 2.2

    working orig .csproj before trying to upgrade

     

    <div><Project Sdk="Microsoft.NET.Sdk.Web">

     

      <PropertyGroup>

       <TargetFramework>netcoreapp2.1</TargetFramework>

      </PropertyGroup>

      <ItemGroup>

       <PackageReference Include="Microsoft.AspNetCore.App" />

       <PackageReference Include="Microsoft.AspNetCore.Razor.Design" Version="2.1.2" PrivateAssets="All" />

       <PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="2.1.1" />

       <PackageReference Include="Microsoft.EntityFrameworkCore.SQLite" Version="2.1.1" />

       <PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="2.1.1" />

       <PackageReference Include="Oracle.EntityFrameworkCore" Version="2.18.0-beta3" />

      </ItemGroup>

    </Project>

     Thanks

    </div>

    Tuesday, July 30, 2019 3:25 PM

Answers

  • User711641945 posted

    Hi poR,

    Did you migrate razor crud proj from 2.1 to 2.2.4 successfully without upgrading bootstrap?

    4.If you use bootstrap,You could change the version because in .net 2.1 bootstrap's version is 3.7 and in .net 2.2 bootstrap version is 4.3.

    This sentence means that It is a possible solution if the migration failed.But if you migrate successfully,there is no need to care about it.

    Best Regards,

    Rena

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, August 1, 2019 9:19 AM

All replies

  • User475983607 posted

    Migration steps can be found in the standard ASP.NET Core docs.

    https://docs.microsoft.com/en-us/aspnet/core/migration/21-to-22?view=aspnetcore-2.2&tabs=visual-studio

    Tuesday, July 30, 2019 5:36 PM
  • User711641945 posted

    Hi poR,

    poR

    C:\Program Files\dotnet\sdk\2.1.403\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.TargetFrameworkInference.targets(137,5): error NETSDK1045: The current .NET SDK does not support targeting .NET Core 2.2. Either target .NET Core 2.1 or lower, or use a version of the .NET SDK that supports .NET Core 2.2. [D:\RazorCRUD\RazorCRUD.csproj]

    Be sure the version of the sdk you downloaded is the same with your Visual Studio.Also,pay attention to the folder you installed.If your VS is 64bit, the sdk Installation package should be installed in C:\Program Files\dotnet. If your VS is 32 bit,the sdk Installation package should be installed in C:\Program Files(x86)\dotnet.

    You could follow mgebhard's advice  to migrate.Or you could follow this link to migrate more easily: https://stackoverflow.com/a/54275715/11398810

    1.You need add the version 2.2.4 in this PackageReference. Then if you had errors saying that some of the packages were not compatible, changed the versions of those as well. 

    <ItemGroup>
    
         <PackageReference Include="Microsoft.AspNetCore.App" Version="2.2.4" />
    
      </ItemGroup>

    2.You need to update the compatibility version in Startup.ConfigureServices to Version_2_2: 

    services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_2);.

    3.Also, to use the faster in-process hosting model for IIS, add <AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel> to your .csproj file after <TargetFramework>netcoreapp2.2</TargetFramework>

    4.If you use bootstrap,You could change the version because in .net 2.1 bootstrap's version is 3.7 and in .net 2.2 bootstrap version is 4.3.

    Best Regards,

    Rena

    Wednesday, July 31, 2019 2:02 AM
  • User915516305 posted

    Hi,

    Thanks for replies -

    re point 4 this is razor crud developed using tutorial on ms website - believe uses bootstrap - which file(s_ specify the bootstrap version?

    Thanks

    Wednesday, July 31, 2019 1:36 PM
  • User475983607 posted

    Hi,

    Thanks for replies -

    re point 4 this is razor crud developed using tutorial on ms website - believe uses bootstrap - which file(s_ specify the bootstrap version?

    Thanks

    Open a Bootstrap file, js or css, and read the first line. It has the version.

    Wednesday, July 31, 2019 1:42 PM
  • User915516305 posted

    looking at site.css - can't see it as visible.  used https://docs.microsoft.com/en-us/aspnet/core/data/ef-rp/intro?view=aspnetcore-2.2&tabs=netcore-cli

    <div style="color: #d4d4d4; line-height: 19px; font-family: Consolas, 'Courier New', monospace; font-size: 14px; font-weight: normal; white-space: pre; background-color: #1e1e1e;"> <div>/* Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification </div> <div>for details on configuring this project to bundle and minify static web assets. */</div>
    <div></div> <div>.navbar-inverse { background-color: #063d73 !important; }</div>
    <div>.nav.navbar-nav.navbar-right li a {</div> <div>    color: white;</div> <div>}</div> </div>

    Wednesday, July 31, 2019 1:50 PM
  • User475983607 posted

    And that is because site.css is your CSS file. 

    You need to open the actual bootstrap source files not yours; bootstrap.css or bootstrap.js.

    Wednesday, July 31, 2019 2:56 PM
  • User915516305 posted

    Thanks for reply

    found a file in bootstrap folder called bower.json

    assume just need to change 3.3.7 to 4.3

    {
      "name": "bootstrap",
      "description": "The most popular front-end framework for developing responsive, mobile first projects on the web.",
      "keywords": [
        "css",
        "js",
        "less",
        "mobile-first",
        "responsive",
        "front-end",
        "framework",
        "web"
      ],
      "homepage": "http://getbootstrap.com",
      "license": "MIT",
      "moduleType": "globals",
      "main": [
        "less/bootstrap.less",
        "dist/js/bootstrap.js"
      ],
      "ignore": [
        "/.*",
        "_config.yml",
        "CNAME",
        "composer.json",
        "CONTRIBUTING.md",
        "docs",
        "js/tests",
        "test-infra"
      ],
      "dependencies": {
        "jquery": "1.9.1 - 3"
      },
      "version": "3.3.7",
      "_release": "3.3.7",
      "_resolution": {
        "type": "version",
        "tag": "v3.3.7",
        "commit": "0b9c4a4007c44201dce9a6cc1a38407005c26c86"
      },
      "_source": "https://github.com/twbs/bootstrap.git",
      "_target": "v3.3.7",
      "_originalSource": "bootstrap",
      "_direct": true
    }

    Wednesday, July 31, 2019 3:04 PM
  • User475983607 posted

    poR

    Thanks for reply - cannot see files called bootstrap.css or bootstrap.js but thought the tutorial on the websites used bootstrap as the site resizes automatically?

    The source files are located in wwwroot/lib/bootstrap for ASP.NET Core 2.2 templates.  The _layout file also has the path to the files.

    I recommend contacting the author If you are having a trouble with the tutorial. 

    assume just need to change 3.3.7 to 4.3

    Read the Bootstrap 3 to Bootstrap 4 migration docs as you might have to update the HTML; https://getbootstrap.com/docs/4.0/migration/

    Wednesday, July 31, 2019 3:29 PM
  • User915516305 posted

    Thanks for reply.

    Nor=tice the bootstrap.js has several references to 3.3.7

      Modal.VERSION  = '3.3.7'

    Also the crud seems tow work in 2.2 without changing bootstrap from 3.7 to 4.3 thus is it just presentationsal e.g. css related and can leave running bootsrap 3.7 if wish?

    Wednesday, July 31, 2019 3:42 PM
  • User475983607 posted

    Bootstrap has absolutely nothing to do with CRUD.  Bootstrap is a response library. 

    You'll need to read the Bootstrap migration documentation linked above if you want to migrate to Bootstrap 4.   Or just leave bootstrap 3.7.

    Wednesday, July 31, 2019 3:49 PM
  • User711641945 posted

    Hi poR,

    Did you migrate razor crud proj from 2.1 to 2.2.4 successfully without upgrading bootstrap?

    4.If you use bootstrap,You could change the version because in .net 2.1 bootstrap's version is 3.7 and in .net 2.2 bootstrap version is 4.3.

    This sentence means that It is a possible solution if the migration failed.But if you migrate successfully,there is no need to care about it.

    Best Regards,

    Rena

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, August 1, 2019 9:19 AM
  • User915516305 posted

    Hi Rena,

    worked without upgrading bootstrap.

    yes - thanks for your help.

    Thanks

    Thursday, August 1, 2019 10:38 AM