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

Bundling and filenames with dots #36

Open
pkmckay147 opened this issue May 8, 2017 · 1 comment
Open

Bundling and filenames with dots #36

pkmckay147 opened this issue May 8, 2017 · 1 comment

Comments

@pkmckay147
Copy link

Hi there,

I know I've read this somewhere in an article about this project - but I can't seem to find it now so I thought I would put it on here.

I am running into issues when attempting to use the VPP with bundling. In particular, with files from commonly used libraries (jQuery and Kendo).

`var assemblies = System.Web.Compilation.BuildManager.GetReferencedAssemblies()
.Cast()
.Where(a => a.GetName().Name.StartsWith("MyNamespace"));

        BundleTable.VirtualPathProvider = new Vpp(assemblies.ToArray());

        bundles.Add(new ScriptBundle("~/bundles/kendo").Include(
          "~/Scripts/kendo/2017.2.504/kendo.all.min.js",
          "~/Scripts/kendo/2017.2.504/kendo.aspnetmvc.min.js"));`

This is failing due to the dots in the javascript filenames. I should point out that these scripts aren't actually in my class library, but are instead in my local MVC project.

I have downloaded the source code and attempted to debug this myself, but am not really getting anywhere. I can see that if I rename the files to not have any dots, the Vpp.GetFile method is called and everything works from there. If the dots are there, this method never gets called.

Why does it not get called? Where is the code that is preventing this?

Thanks

@mcintyre321
Copy link
Owner

First of all it's worth knowing that when you embed resources, you lose some path information (e.g. some characters get turned to . and -, and if you're using VS2017 csproj, the compiler has a slightly different algorithm). Use IlSpy to look at the final resource names in your assembly.

Secondly I didn't implement the bundling feature myself, it came in a PR so all I can suggest is that you download the source and add the project locally to your solution so you can debug it. Sorry!

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

2 participants