turquoiseowl / i18n

Smart internationalization for ASP.NET
Other
556 stars 156 forks source link

WebResource.axd is blank #255

Closed joero4 closed 8 years ago

joero4 commented 8 years ago

Hello, I'm running version 2.1.6 form nuget, and our WebResource.axd file is blank. I read that you fixed the problem back in April, but I'm still seeing the issue.

Thanks, Joe

turquoiseowl commented 8 years ago

@gitsno May I defer to you on this?

@joero4 As a fallback, have you tried adding the .axd resources to the i18n.LocalizedApplication.Current.UrlsToExcludeFromProcessing regex?

Ref: #193

joero4 commented 8 years ago

i18n.LocalizedApplication.Current.UrlsToExcludeFromProcessing = new Regex("(?:.(?:less|css|js|axd)(?:\?|$))|(?i:i18nSkip|glimpse|trace|elmah)")

This is our setting right now. Is this correct?

Thanks, Joe

turquoiseowl commented 8 years ago

That should match .axd okay, although you might escape the first period with a backslash.

Are you saying with that set, the .axd resources are being modified by i18n?

If so, short of help from @gitsno or someone else who has got it to work in your environment, I can only suggest referencing a local build of i18n from your project and debugging a request to see what's going on. There is quite a lot of trace output in the debug build, and I would suggest putting breakpoints in the event handlers in i18n.LocalizingModule, in particular OnPostRequestHandlerExecute.

joero4 commented 8 years ago

Strange, the copy paste must have striped the backslash, it's there in my code.

To be exact the WebResource.axd file is coming back blank. We have 3 other ScriptResource.axd files which are fine. It's only the WebResource.axd file that is affected.

Thanks, Joe

turquoiseowl commented 8 years ago

There is a direct reference to /webresource.axd in LocalizingModule.OnPostRequestHandlerExecute, but not to any other axd files. This may be why ScriptResource.axd is okay, but webresource.axd is not.

An avenue would be to remove that code yourself and see if that makes a difference.

turquoiseowl commented 8 years ago

No response so closing. Feel free to re-open with further comment.

gitsno commented 8 years ago

Sorry for not replying sooner, the notifications about this issue were blocked in my spam filter. The fix I made last year was specifically for webresource.axd, (not scriptresource.axd) because as far as I could tell the issue only affects webresource.axd - I have never seen it happen with scriptresource.axd. As I note in my comments for the fix I exclude both files from i18n processing anyway - here's my exclusion regex, yours seems OK, but mine is different so maybe try this (all one line from my global.asax Application_Start):

i18n.LocalizedApplication.Current.UrlsToExcludeFromProcessing = new System.Text.RegularExpressions.Regex(@"(?:\.(?:less|css|js)(?:\?|$))|(?i:i18nSkip|glimpse|trace|elmah|ScriptResource\.axd|WebResource\.axd)");