1

ClientApp

Tried to publish an Angular ASP.NET Core application in IIS but it is not working already tried this solution but cannot solve it Deploying Angular 6 ASP.NET Core application

Already tried this one.

public void ConfigureServices(IServiceCollection services)
{            services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1);
    ....
    // In production, the Angular files will be served from this directory
    services.AddSpaStaticFiles(configuration =>
    {
        configuration.RootPath = "ClientApp/dist/ClientApp";//change here
    });

     ...
}

Am I missing something?

3
  • Are you absolutely certain that your configuration.RootPath path is correct? Does the ClientApp/dist/ClientApp directory exist in your project's wwwroot folder or somewhere else? What happens if you specify an absolute path instead? Commented Jun 19, 2020 at 1:58
  • @Dai No it is placed somewhere else. its not inside the wwwroot folder. When i published it. It creates a ClientApp/dist/ClientApp folder Commented Jun 19, 2020 at 2:23
  • check this link: stackify.com/how-to-deploy-asp-net-core-to-iis Commented Jun 19, 2020 at 6:39

1 Answer 1

2

Fixed this by modifying the <base href="/"> to <base href="./"> in index.html

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.