Step-by-step for the ABP Project

Source: Internet
Author: User

Step-by-step for the ABP Project

1. Download the ABP Project template,

Go to https://aspnetboilerplate.com/templates, select multipage Web Application, enter the Project name and verification code, and click Create My Project to download the code.

 

2. After the download is complete, it will jump to the terminal.

 

3. Install the latest version of VS2017, must be v15.3.5 or above, if the computer system is window7, also need to install update https://www.microsoft.com/en-us/download/details.aspx? Id = 40855 (power shell 4.0). The nuget console of vs2017 must be more than power shell 3.0.

 

4. Use vs2017 to open the downloaded project. Open tool-> Option-> nuget Package Manager-> package source, add a package Source Address: sources,

Then generate the project

 

5. Generate a database

(1) Find the appsettings. json file in the MyABP. Web. Mvc project and set the database connection string as needed.

(2) Open the tool> nuget Package Manager> Package Manager Console and change the default project to MyABP. entityFrameworkCore, enter the Update-Database command, and press Enter. Here, you need to execute the command twice. Anyway, I only execute the command once to generate a Database without a table ..

(3) set MyABP. web. mvc is the startup project and is set to run as MyABP. web, without IIS, run the project to see the website open login interface, enter the User name: admin, password: 123qwe, you can open the Home Page

 

(4) Click Tenants. If the database is sql2005 or sql2008, the following error occurs: SqlException: syntax error near 'offset. The option NEXT in the FETCH statement is invalid.

The default paging SQL statement generated by ef core does not support databases of earlier versions. Modify the MyABPDbContextConfigurer file in the myabc. EntityFrameworkCore project as follows:

Public static class MyABPDbContextConfigurer {public static void Configure (DbContextOptionsBuilder <MyABPDbContext> builder, string connectionString) {// builder. useSqlServer (connectionString); // supports sql2005, 2008 paging builder. useSqlServer (connectionString, B => B. useRowNumberForPaging ();} public static void Configure (DbContextOptionsBuilder <MyABPDbContext> builder, DbConnection connection) {// builder. useSqlServer (connection); // supports sql2005, 2008 paging builder. useSqlServer (connection, B => B. useRowNumberForPaging ());}}

  

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.