5

I downloaded the free template for a single-page application with ASP.Net Core 2.x and EntityFramework Core 2.x. version 3.9.0.

After unpacking the archive, I did not found the project ProjectName.Web.MVC in the solution. If I understand correctly, I need to somehow generate it. But neither on the official documentation site, nor here I found a single word about how to do it. There is a file 3.9.0/aspnet-core/build/build-mvc.ps1 in the archive, maybe I need to use it somehow?

How to compile/generate/create an ProjectName.Web.MVC project for using Vue.js?

XelaNimed
  • 301
  • 5
  • 18
  • If you want MVC, choose MVC instead of Vue.js. – aaron Jun 20 '18 at 11:37
  • Frankly, you don't need a starter template. VueJS is best used by **not** integrating it into another project directly. Use ASP.net to build an API (let's say REST) only, don't use any views, just create an API that provides data. Then create a separate vue project using the vue-cli and grab data from your Backend API using asynchronous HTTP Calls. Axios and Vuex are libraries you want to have a deep look into here. This setup provides you with way more flexibility than some boilerplate template that integrates vue in a way that it's not meant for in the first place. – Philip Feldmann Jun 20 '18 at 12:46
  • 1
    I think it's an extremely narrow view of Vue to think that it would or should only be used to build a SPA, and that you shouldn't use a framework like ASP.NET MVC with it. One of the primary wins of Vue over Angular/React is that it can *easily* be used to enhance pages, and that you can gradually ramp up *if that is a requirement*. That said simply googling "dotnet core vue" turns up several templates for Vue in the first few results. – Bert Jun 20 '18 at 13:13

1 Answers1

4

I solved this problem as follows.

First, need to understand that when you debug/start a project in VisualStudio, only WebAPI starts. To start vue, you need installed Node.js, Yarn and following npm packages like so:

npm install -g webpack, vue-cli, babel-cli, babel-preset-env

If any packages are redundant, then tell me in comments.

After that, I started the project from VisualStudio and called following NPM commands in the console in vue folder npm install --save-dev. After this dependencies loaded to node_modules folder. At last run npm command npm run serve. Now vue available at URL http://localhost:8080.

XelaNimed
  • 301
  • 5
  • 18