Learning ABP ASP. NET Core with Angular environmental issues

Source: Internet
Author: User

1. Preface 

Recently learning ABP architecture to build ASP. NET Core with angular encountered some problems, a week after the end of the day to solve, think about the pain of the process to use the blog to record down. Actually always wanted to write a blog, but because the time is busy and lazy has not been written. Before also encountered some problems, cost a lot of effort finally solved, but after a long time and encountered similar problems, but can not think how to solve before, and a variety of Baidu to try to solve, so the advantage of blogging is recorded.

2. Download ASP. NET Core 2.x + angular code

Download the latest version of ASP 2.x + angular on the ABP website (https://aspnetboilerplate.com)

3. Background compilation run

After download press the official instructions background compile run everything OK

Introduction

The easiest-starting a new project using ABP with asp . Angular is to create a TEMPLA Te on Templates page. Remember to check "Include module Zero". After creating and downloading your project, follow below steps to run your application.

ASP. NET Core Application
      • Open your solution on Visual Studio 2017+ and build the solution.
      • Select the 'web.host' project as startup Project.
      • Open Package Manager Console and run update-database command to the Create your Database (ensure that Def Ault Project is selected as . Entityframeworkcore in the Package Manager Console window).
      • Run the application. It would show Swagger-ui If it is successfull:

4. Angular project run encountered error

When running the angular project, has not been able to run up the error, began to think that it is my computer environment installation problems, has been unloading load, what node, typescript, Angular/cli Reloaded a time, NPM install installation is successful, main card in NPM start , to the end has been reported error webpack wrong, find a lot of information, I think it should be the wrong version of the installation package. Finally found the official documents, and the official documents to do it again or not, and the environment to install the package version of the check is right, but in the document to see yarn Description, and then point in to understand a bit

5. Problem diagnosis and resolution

In the error message also appeared yarn does not support the description (in the Civil Service Network: https://yarnpkg.com/zh-Hans/), definitely to this yarn about, so download installation, but after the installation command has been invalid, and finally restart the computer, the computer restarts after the command can be used, stealing Hi, Then remove the package for NPM install, then NPM start, or error. So I learned a bit more about yarn's description and use, and found an article that says the difference between yarn and NPM (http://web.jobbole.com/88459/)

Speed/ Consistency is not guaranteed during installation

Security issues because the code is allowed to run when NPM is installed

This is an important two point for NPM, this consistency is important, I suspect that my environment installation package and the author's environment installation package is inconsistent, so I looked at yarn related use and syntax, I first tried NPM install, and then yarn INSTALL,NPM Start to find or error, wrong information is not the same, and finally deleted the Node_modules directory, re-yarn install,npm start, run successfully!!

6. Summary

Through this problem solving process, let me understand yarn, is as described on the official website (https://yarnpkg.com/zh-Hans/) as fast, reliable, secure dependency management . Reliability allows you to install dependent packages on different computers in a consistent environment, I just because of the dependency environment inconsistent with the author install package cause the running is not successful, the environment is inconsistent often because of some package upgrade after the NPM installation package is not accurate caused by the problem.

At the same time, encounter problems to persist to solve, meet new technologies to understand first, but also to develop the habit of blogging, encountered problems recorded.

Learning ABP ASP. NET Core with Angular environmental issues

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.