سلام استاد وقت بخیر
در پروژه از AddWebMarkupMin استفاده شده که در عکس میتوانید مشاهد کنید ولی متاسفانه html minify نمیشه
ولی یک چیز عجیب که در admin پروژه minify میشه ولی در بقیه قسمت ها نه ممنون میشم راهنمایی کنید و در پروژه
Web Application خام که میسازم همه چیز درسته ولی تمام مراحل را که مو به مو در پروژه خودم انجام میدم minify نمیشه

صفحه اصلی

و صفحه ادمین

سلام دوست من
لطفا تمامی کدهای فایل program.cs و startup.cs رو ارسال کنین
public void ConfigureServices(IServiceCollection services)
{
#region config services
services.AddControllersWithViews();
services.AddScoped(typeof(IGenericRepository<>), typeof(GenericRepository<>));
services.AddScoped<IUserService, UserService>();
services.AddScoped<IAddressService, AddressService>();
services.AddScoped<ISiteService, SiteService>();
services.AddScoped<IBlogService, BlogService>();
services.AddScoped<IPasswordHelper, PasswordHelper>();
services.AddHttpClient<ICaptchaValidator, GoogleReCaptchaValidator>();
services.AddScoped<ISmsService, SmsService>();
services.AddScoped<IContactService, ContactService>();
services.AddScoped<ISellerService, SellerService>();
services.AddScoped<IExpertService, ExpertService>();
services.AddScoped<IProductService, ProductService>();
services.AddScoped<IOrderService, OrderService>();
services.AddScoped<IResultCheckService, ResultCheckService>();
services.AddScoped<ISellerWalletService, SellerWalletService>();
services.AddScoped<ISiteWalletService, SiteWalletService>();
services.AddScoped<IProductDiscountService, ProductDiscountService>();
services.AddScoped<ILearningService, LearningService>();
services.AddScoped<IPaymentService, PaymentService>();
services.AddScoped<IViewRenderService, RenderViewToString>();
services.AddRazorPages();
services.AddWebMarkupMin(option =>
{
option.AllowMinificationInDevelopmentEnvironment = true;
option.AllowCompressionInDevelopmentEnvironment = true;
})
.AddHtmlMinification()
.AddHttpCompression()
.AddXhtmlMinification();
#endregion
}
public void ConfigureServices(IServiceCollection services)
{
#region config services
services.AddControllersWithViews();
services.AddScoped(typeof(IGenericRepository<>), typeof(GenericRepository<>));
services.AddScoped<IUserService, UserService>();
services.AddScoped<IAddressService, AddressService>();
services.AddScoped<ISiteService, SiteService>();
services.AddScoped<IBlogService, BlogService>();
services.AddScoped<IPasswordHelper, PasswordHelper>();
services.AddHttpClient<ICaptchaValidator, GoogleReCaptchaValidator>();
services.AddScoped<ISmsService, SmsService>();
services.AddScoped<IContactService, ContactService>();
services.AddScoped<ISellerService, SellerService>();
services.AddScoped<IExpertService, ExpertService>();
services.AddScoped<IProductService, ProductService>();
services.AddScoped<IOrderService, OrderService>();
services.AddScoped<IResultCheckService, ResultCheckService>();
services.AddScoped<ISellerWalletService, SellerWalletService>();
services.AddScoped<ISiteWalletService, SiteWalletService>();
services.AddScoped<IProductDiscountService, ProductDiscountService>();
services.AddScoped<ILearningService, LearningService>();
services.AddScoped<IPaymentService, PaymentService>();
services.AddScoped<IViewRenderService, RenderViewToString>();
services.AddRazorPages();
services.AddWebMarkupMin(option =>
{
option.AllowMinificationInDevelopmentEnvironment = true;
option.AllowCompressionInDevelopmentEnvironment = true;
})
.AddHtmlMinification()
.AddHttpCompression()
.AddXhtmlMinification();
#endregionسلام دوست من
سرویس ها رو 2 بار تنظیم کردین؟
نه اشتباه شده
public static IHostBuilder CreateWebHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args)
.ConfigureWebHostDefaults(webBuilder =>
{
webBuilder.UseStartup<Startup>();
webBuilder.UseNLog();
});
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
app.Use(async (context, next) =>
{
await next();
if (context.Response.StatusCode == 404)
{
context.Response.Redirect("/Home/Error404");
}
});
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
else
{
app.UseExceptionHandler("/Home/Error");
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
app.UseHsts();
}
app.UseHttpsRedirection();
app.UseStaticFiles();
app.UseWebMarkupMin();
app.UseRouting();
app.UseAuthentication();
app.UseAuthorization();
app.UseEndpoints(endpoints =>
{
endpoints.MapControllerRoute(
name: "areas",
pattern: "{area:exists}/{controller=Home}/{action=Index}/{id?}"
);
endpoints.MapControllerRoute(
name: "default",
pattern: "{controller=Home}/{action=Index}/{id?}");
});
}احیانا از کش استفاده نکردین؟
احتمال میدم صفحه ی شما کش شده باشه
نه فکر نکنم چون در web هم که publish کردم همینطور بود
در صورت امکان سورس کد پروژه و اسکریپت دیتابیس رو ارسال کنین برای بررسی