Open Closed

Deploy project Angular / EF Core on Windows Server 2019 IIS 10 #765


User avatar
0
christophe.baille created

Check the docs before asking a question: https://docs.abp.io/en/commercial/latest/ Check the samples, to see the basic tasks: https://docs.abp.io/en/commercial/latest/samples/index The exact solution to your question may have been answered before, please use the search on the homepage.

  • ABP Framework version: v4.0.0

  • UI type: Angular

  • DB provider: EF Core

  • Identity Server Seperated (Angular): yes

  • Exception message and stack trace: IIS Server log file (backend log): CORS policy execution successful. CORS request made for path: /api/app/user-role/roles-of-currentf-user from origin: http://..net but was ignored because path was not for an allowed IdentityServer CORS endpoint No CORS policy found for the specified request.

  • Steps to reproduce the issue: I want to deploy the solution on IIS. I created 2 sites (url have been changed for the public question): test.app.com --> on here I publish the angular project apitest.app.com --> on here I publish the dotnet project

for tests purpose, I do not use https.

From a browser, I can reach swagger successfully through api.test.app.com.

From the browser, I can reach the Angular successfully through test.app.com. However, I get the error said on * Exception message and stack trace After that, if I click on login button, nothing happened and nothing appears on the browser console.

I guess I did put the correct information on appsettings.json:

"App": { "SelfUrl": "http://apitest.app.com", "ClientUrl": "http://test.app.com", "CorsOrigins": "http://test.app.com,http://localhost:4200,https://localhost:44307,https://localhost:44348" }, "ConnectionStrings": { "Default": "Server=.\;Database=;User ID=;Password=;Trusted_Connection=;MultipleActiveResultSets=true" }, "AuthServer": { "Authority": "http://apitest.app.com", "RequireHttpsMetadata": "false" },

Any help about the deployment would be welcome. Do I do the right way by using 2 different sites?If yes, what is wrong as I am out of idea now...

I first tried to create one "main" site hosting Angular, where I did add an Application on API, but I was not able to reach through the API path.

Thanks for your help


10 Answer(s)
  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Can I check it remotely? shiwei.liang@volosoft.com

  • User Avatar
    0
    christophe.baille created

    Sure, I sent you an email to ask how to proceed

  • User Avatar
    1
    liangshiwei created
    Support Team Fullstack Developer

    The problem has been solve, if you have any question, please reopen.

  • User Avatar
    0
    tqm created

    I have the same problem. Has the problem been solved?

  • User Avatar
    0
    christophe.baille created

    I had few issues, first the back-end need to be in https (in my tests it was not working otherwise). Plus need to be sure that the appsettings.json from DbMigrator has correct information as it fills the table IdentityServerClientRedirectUris. My issue was from here a I had App redirect url to localhost still.

    Hope it will help

  • User Avatar
    0
    christophe.baille created

    I wanted to know if it was possible to make the hosting differently.

    Instead of having 2 subdomains http://apitest.app.com and http://test.app.com

    We will have only one domain app.com for the frontend and the API will be on app.com/API

    Is there any way to do it? I made some test but anytimes it fails to communicate each other

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    You can deploy API as a sub appliation.

    See https://devblogs.microsoft.com/aspnet/part-1-of-3-creating-sub-projects-in-iis-with-web-application-projects/

  • User Avatar
    0
    christophe.baille created

    I am sorry but it is not accurate with my project:

    • I have an Angular project and a .NET (ABP) project
    • The settings there are different (the post is from 2006 so they might use VS 2005).

    Here they explain on how to make an asp apllication child of another on a same solution whicj contains 2 web applications

    Creating sub-projects under a root project

    Once the root project is up and running fine, the next step is to create a sub-project and set it up so it builds and runs as part of the same ASP.NET application represented by the root project.

  • User Avatar
    0
    alper created
    Support Team Director

    @christophe, can you pls create a new topic for the new question. when we solve the major issue we generally close the ticket. this is good for others to track the issue.

  • User Avatar
    0
    christophe.baille created

    @alper, OK no problem

Made with ❤️ on ABP v9.1.0-preview. Updated on December 13, 2024, 06:09