我们在我们的站点中使用MVC Bundling,CssRewriteUrlTransform确保图像URL在动态bundle css文件中工作.
但这只适用于不使用虚拟目录的情况,即
http://localhost/VirttualDir不行,但http://localhost/确实如此.这是因为CssRewriteUrlTransform在重写URL时,转换不会考虑虚拟文件夹.因此,如果图像真实路径是localhost/vdir/content/img/foo.png它将重写它localhost/content/img/foo.png是错误的