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

SpriteVirtualPath not correctly mapped #189

Closed
jaap34 opened this issue Jun 3, 2012 · 5 comments
Closed

SpriteVirtualPath not correctly mapped #189

jaap34 opened this issue Jun 3, 2012 · 5 comments

Comments

@jaap34
Copy link

jaap34 commented Jun 3, 2012

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:

[assembly: WebActivator.PreApplicationStartMethod(typeof(RequestReduceConfiguration), "Start")]
namespace Framework.UI.Resources
{
    public static class RequestReduceConfiguration
    {
        public static void Start()
        {
            DynamicModuleUtility.RegisterModule(typeof(RequestReduceModule));
            RequestReduce.Api.Registry.Configuration.SpriteVirtualPath = "~/repository/cache";
        }
   }
}

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.

@jaap34
Copy link
Author

jaap34 commented Jun 3, 2012

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.

@mwrock mwrock closed this as completed Jun 5, 2012
@jaap34
Copy link
Author

jaap34 commented Jun 6, 2012

Shouldn't the Configuration properties behave in the same way as the properties in web.config?

@mwrock mwrock reopened this Jun 6, 2012
@mwrock
Copy link
Owner

mwrock commented Jun 6, 2012

hard to argue that. yes.

@candrews
Copy link

candrews commented Jun 6, 2012

Could this problem be the same problem as #191?

@mwrock
Copy link
Owner

mwrock commented Jun 10, 2012

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.

@mwrock mwrock closed this as completed Jun 10, 2012
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