Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to clear templates cache in IIS? #543

Closed
navff opened this issue Jan 17, 2019 · 2 comments
Closed

How to clear templates cache in IIS? #543

navff opened this issue Jan 17, 2019 · 2 comments

Comments

@navff
Copy link

navff commented Jan 17, 2019

I updated my templates, but there no effect on IIS server. Template files on server have been updated, but there is an old copy of the template somewhere. Restarting IIS have no effect and my email sending by old templates.

public string ConfirmOrderUserMessage(BookViewModelEmail book, MessageFormat format)
        {
            string templateFileName = "order-confirm-user.cshtml"; 
            if (format == MessageFormat.Txt)
            {
                throw new NotImplementedException();
            }
            DynamicViewBag viewBag = new DynamicViewBag();
            viewBag.AddValue("BaseUrl", _baseUrl);

            var p = Path.GetFullPath(Path.Combine(_pathToTemplates, templateFileName));
            var template = File.ReadAllText(p);
            var result = Engine.Razor.RunCompile(template, "ConfirmOrderUserMessage" + format, null, book, viewBag);
            return result;
        }

Some screenshots:
https://i.imgur.com/sqoXd0s.png
https://i.imgur.com/FU233fQ.png

How to force IIS to forget old templates?

@baphamsts
Copy link

I got the same with excel, still cannot detect the issue.

@xakml
Copy link

xakml commented Nov 1, 2019

我尝试对已缓存的模板进行删除或重新编译,但没找到相关的逻辑或操作方法,不止楼上问题是否已解决?

@navff navff closed this as completed Feb 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants