dotnet core
-
Has anybody successfully build an app with quasar-framework and dotnet core?
Or maybe somebody can guide me in the right direction to develop one?
I have developed a webapp with this starter kit: https://github.com/MarkPieszak/aspnetcore-Vue-starter
Now I want to develop another one with same starter kit AND quasar-framework.
Should I use UMD or starterKit from quasar and include everything I need for .net core manually?thx for your help
a-x-i
-
Hi Axi,
I have have a few projects that I have made with dotnet core. I didn’t use any premade template though. I created a regular quasar project with quasar init, I then created a folder called backend. I then used the dotnet cli (dotnet new web) to create a new empty dotnet project. After that is setup I created a build script that would clean/build both quasar and the dotnet project, and copy the built quasar project files to the wwwroot folder of dotnet.
Not sure if this is the best approach, but I haven’t had any issues yet. Let me know if you have anymore questions, or want my build script.
Thanks
-
Hi!
Thank you for your input.
If you can assist me with your script, it would be very helpful.
But one more question: the starter kit I mentiond is a mvc project, so how would I handle this with a dotnet core mvc project because the view of mvc has to be totally replaced with my quasar/vue view
thx
a-x-i
-
I have setup a basic template for you here https://github.com/MitchellMonaghan/DotnetCoreQuasar
This is how I have setup my projects so far. I let the vue/quasar deal with everything front end related and dotnet core manages db/api/auth etc. I don’t have any views in my dot net core application. All pages and routing is handled by vue/quasar, and api requests are made for needed data for each page.
Hope this helps
-
Okay I got you!
You have two separate applications. One with dotnet core and one with vue/quasar.The starter-kit I mentioned has a totally different approach. It’s a .net core mvc-app which uses vue.js and javascript.
The template from dotnet core does the same but with typescript.
The only thing I missed was quasarand I didn’t find any solution so I thought I wait for the umd-version of quasar and now I’m here
Maybe your way will also be my kind of solution!
Thanks a lot again for your help and your time!
a-x-i
-
Yes when I am running a dev environment I run the back end in vscode(ctrl + f5) to debug, and I run quasar separately with quasar dev. When you build for production it will all be one application as the dotnet core serves static files from the wwwroot folder. the build.js file should handle all your build needs.
-
Hi Mitchell,
I’ve tried out your template and got it working - thanks for sharing.
I tried building my own similar one except with Quasar v1.0.0 beta & .NET Core 2.1. However I’ve run into the following issue:
“Access to XMLHttpRequest at ‘https://localhost:5001/api/values’ (redirected from ‘http://localhost:8080/api/values’) from origin ‘http://localhost:8080’ has been blocked by CORS policy: No ‘Access-Control-Allow-Origin’ header is present on the requested resource.”
Did you have this issue and if so how do you get around it?Thanks,
Eoin. -
The backend (.net core) does not allow to make the request from a different domain. Another port is also restricted. Have a look at this site for solving your problem: https://docs.microsoft.com/en-us/aspnet/core/security/cors?view=aspnetcore-2.2
I have solved it with this code:options.AddPolicy(quasarOrigins, builder => { builder.WithOrigins("http://localhost:8080") .AllowAnyHeader(); });
a-x-i
-
Thanks Axi. I had come across that page too and tried implementing it but it wasn’t working for me. Eventually discovered that I was including a forward slash at the end of the 8080 and this was causing the issue. I hate it when it’s something small like that.
On a side note, I didn’t see any sort of CORS policy in Mitchell’s sample template, do you know why that is? As far as I see, the frontend and backend are set up to run on different ports.