Closed jaap34 closed 12 years ago
I have managed to get it working by setting the paths as following;
RequestReduce.Api.Registry.Configuration.SpritePhysicalPath = HostingEnvironment.MapPath("~/repository/cache");
RequestReduce.Api.Registry.Configuration.SpriteVirtualPath = Utility.ResolveUrl("~/repository/cache");
Utility.ResolveUrl is a custom method which resolves relative to absolute url.
Shouldn't the Configuration properties behave in the same way as the properties in web.config?
hard to argue that. yes.
Could this problem be the same problem as #191?
This is most likely unrelated. The problem was that the SpriteVirtualPath was being translated to the absolute path at initialization of the configuration and never again. So passing in new values through the API were not resolving the tilde.
When not using the web.config, but WebActivator.PreApplicationStartMethod to configure and initialize RequestReduce, something goes wrong with the output path of the resources.
The code:
The output in the HTML becomes:
~/repository/cache/4556dbb543035982a75b0059a0806b18-6db26c880265f8bd42293e18e1fea26a-RequestReducedScript.js
(should be absolute url)
Though the files are correctly combined and minified and stored to the specified path.