No More Posting New Topics!

If you have a question or an issue, please start a thread in our Github Discussions Forum.
This forum is closed for new threads/ topics.

Navigation

    Quasar Framework

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    dotnet core

    Help
    3
    9
    4107
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • A
      Axi last edited by

      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

      1 Reply Last reply Reply Quote 0
      • M
        mitchellmonaghan last edited by mitchellmonaghan

        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

        1 Reply Last reply Reply Quote 1
        • A
          Axi last edited by

          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

          1 Reply Last reply Reply Quote 0
          • M
            mitchellmonaghan last edited by

            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

            1 Reply Last reply Reply Quote 2
            • A
              Axi last edited by

              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 quasar 😞 and 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

              1 Reply Last reply Reply Quote 0
              • M
                mitchellmonaghan last edited by

                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.

                1 Reply Last reply Reply Quote 0
                • E
                  eoinom last edited by

                  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.

                  1 Reply Last reply Reply Quote 0
                  • A
                    Axi last edited by

                    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

                    1 Reply Last reply Reply Quote 0
                    • E
                      eoinom last edited by

                      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.

                      1 Reply Last reply Reply Quote 0
                      • First post
                        Last post