0

I made some changes to the static file index.html but running via .net-core and inspecting elements these changes do not apply however when I open the static file via live server extension of vscode I can see the changes.

I am very new to .net core, I looked up a few threads but couldn't find what the problem is or a similar one. My Startup class looks as so:

public class Startup
    {
        public Startup(IConfiguration configuration)
        {
            Configuration = configuration;
        }

        public IConfiguration Configuration { get; }

        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddControllers();
            services.AddMvc().ConfigureApiBehaviorOptions(options =>
            {
                options.SuppressConsumesConstraintForFormFileParameters = true;
                options.SuppressInferBindingSourcesForParameters = true;
                options.SuppressModelStateInvalidFilter = true;
                options.SuppressMapClientErrors = true;
                options.ClientErrorMapping[404].Link =
                "https://httpstatuses.com/404";
            });

            

        }

        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }

            app.UseDefaultFiles();
            app.UseStaticFiles();
            app.UseHttpsRedirection();



            app.UseRouting();

            app.UseAuthorization();

            app.UseEndpoints(endpoints =>
            {
                endpoints.MapControllers();

            });
        }
    }

also, the project repository is here

Thanks to everyone who takes their time to help.

userover8k
  • 33
  • 1
  • 5
  • 1
    I can't give you an answer, but IIS tends to cache files and won't read them from disk again unless you restart it. See https://stackoverflow.com/questions/57254048/how-to-cache-static-files-in-asp-net-core and in particular the note and blog about invalidating cached files near the bottom. – user2740650 Nov 10 '20 at 02:12
  • These didn't resolve the problem – userover8k Nov 11 '20 at 23:39
  • Please clarify more about the question and how do you host the app. And do you try to force refresh by pressing Ctrl + F5? Besides, if you have source code, you can do update and republish it then check if it can work well. – Fei Han Nov 19 '20 at 13:40

0 Answers0