I have been trying to create a new project using the new Vue CLI 3 with ASP.Net Core web. I can use dotnet new to create a nice new blank web project, and can use vue create to create a new Vue.js Hello World template but I can't for the life of me get them working together.
It should be pretty straight forward
_Layout.cshtml
or Index.cshtml
, however you want to organize it, reference those outputted files.<div id="app"></div>
into your .cshtml
.I wrote a detailed tutorial available at Medium.
You can use Microsoft Microsoft.AspNetCore.SpaServices
NuGet package to specify SpaStaticFiles folder instead of copying client app on build to wwwroot and ignore *.cshtml files and use directly vue index.html
file.
You can also install VueCliMiddleware
NuGet to run npm process with client app using Vue CLI 3.0 when your .NET app starts.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With