当前位置: 动力学知识库 > 问答 > 编程问答 >

asp.net mvc - SquishIt MVC - Debug mode, not refreshing

问题描述:

We got a MVC project running and we seem to have problem refreshing .less files without actually recycling the pool.

If it was just me, I would not bother with this since everytime I compile, the pool recycle. But, our web integrator doesn't like to rebuild since he doesn't even work within Visual Studio when changing the .less files.

Here's what I do:

  • Got SquishIt from Nuget to the latest version;
  • Calling Bundle.Css().Add(...).Render() in the Layout.cshtml;
  • The csproj is set to compile in debug mode (Configuration Manager);
  • Got in the Web.config file.

I look at almost all entries on the codethinked.com web site and couldn't find what I was looking for. Some people seems to have problems, but not with the file not being regenerated.

Thanks!

网友答案:

Had an answer from Justin Etheredge on google groups. It's going to be fixed in the version 0.8.3.

http://groups.google.com/group/squishit/browse_thread/thread/6643663dda433a68

网友答案:

Try using ForceRelease after your call to .Add

Like this:

.Add("~/Content/lessfiles/site.less")
.ForceRelease()
.Render("~/Content/combined_site_#.css")

After you make the change to include ForceRelease, do your pool recycle once more to make sure you are looking at a fresh file.

Finally, change your .less file with notepad behind the scenes.
The next refresh of the page should pick the change up.

网友答案:

While not a good solution for production, I found running IISReset locally(if you are running through IIS) to be a good way to force squishit to recognize changes.

分享给朋友:
您可能感兴趣的文章:
随机阅读: