3
Vote

Indebug mode (no-combine and no-compress) leave resource url untouched

description

In development/debug mode I want my resources untouched for easy access from debugging tool such as FireBug/Fiddler.
 
However, you still render their url to .axd mode.
Could that be changed to retain the original url - .js and .css?
 
Thanks,
Benny

comments

MilanNegovan wrote Feb 23, 2010 at 1:48 AM

Benny, which debug mode do you mean? Debugging in Visual Studio or setting <compilation debug="true/false"> in web.config?

bhalperin wrote Feb 23, 2010 at 6:41 AM

Milan, neither.
Best would be to identify "debug" mode when the Crunch and Combine properties are both false. So in the following example if DEBUG is on you should leave all untouched:

if DEBUG

StaticResources.Crunch = false;
StaticResources.Combine = false;

else

StaticResources.Crunch = true;
StaticResources.Combine = true;

endif

(StaticResources is your StaticResourceManager class)

Or, add another Boolean property called Ignore (default false) and if set to true supersede the Combine and Crunch settings and leave all untouched.

What do you think?

MilanNegovan wrote Feb 23, 2010 at 1:01 PM

Benny, let me think about it some more. In the meantime, you can use the code you provided right in your master page, for example. It works.

The reason I suggested watching <compilation debug="true/false"> is because Microsoft's AJAX ScriptManager works this way. I'm curious how they accomplished it in medium trust.

borismee wrote Feb 24, 2010 at 11:31 AM

Hi Milan,
I want to clarify this "debug" issue (BTW: Benny is my TM).
When I set crunch and comabine propeties to false, I see in firebug requests to Shinkansen.axd (see it in attached screenshot) for each js/css file.
Is it possible to leave the original file names so it will be easily for us navigate through many js/css files?
Maybe you can just add all these files with standard script tag for js files and link tag for css files?

Thanks

P.S.
I downloaded the latest version of the project with latest fixes/updates. It works great!!!!
Thanks

MilanNegovan wrote Feb 24, 2010 at 1:30 PM

Boris, I see. The original file names... Hm. I'll see if I can get the code to leave them intact in debug mode.

borismee wrote Mar 10, 2010 at 7:56 AM

Hi Milan,
Do you have any progress with the issue?
Thanks

MilanNegovan wrote Mar 10, 2010 at 9:50 PM

Boris, I'm struggling to decide on a best approach.

I'm afraid having Shinkansen bypass minification, URL combining, etc, in debug mode will be confusing to developers. My first thought would be, "Why isn't it working as advertised?!"

Microsoft's AXDs, for example, simply disable compression during debugging, but everything else works the same.

I'm also hesitant to add too many attributes on StaticResourceManager. It's the age-old problem of too many configuration settings which overburden the design. Besides, having different versions of a page for various build environments, e.g. stage, dev, QA, production, would be very difficult.

What do you think of introducing separate "profiles" in web.config, similar to ASP.NET cache profiles. See http://wiki.asp.net/page.aspx/655/caching-in-aspnet/ ? Configuring multiple web.configs for build environments is a good practice, so maybe this is a viable solution.

Thoughts? Ideas?

borismee wrote Mar 11, 2010 at 7:24 AM

Milan,
I think it will great solution to separate the configuration through web.config versions.
It could be something like this: <Shinkansen configSource="App_Data\config\ Shinkansen.config" />
and in each Shinkansen.config external file we'll set the environment parameters.
Thanks

bhalperin wrote Jul 5, 2010 at 7:43 AM

Hi Milan,

Still on this issue.... Can you include in the URL query string the original javascript file name? E.g.:
Shinkansen.axd?t=myscript.js_8Uxablabla...................

Benny

mohitt wrote Sep 1, 2010 at 2:03 PM

Milan,

We also need something like this.Since, it is very difficult to debug even after setting these flags. What, I suggest is that you can leave setting the crunch and compress flag to developer, and if combine is set to be false. You can show the file names in query string. I guess it would work.

Regards
Mohit Thakral

wrote Sep 1, 2010 at 2:06 PM

hakank wrote Jan 3, 2012 at 11:59 AM

Visual Studio IDE is not rendering page in desing mode if i use Shinkansen control.
Debug and Release usage must be configurable for the control.

if DEBUG

endif

block is not working..

hakank wrote Jan 3, 2012 at 12:09 PM

Visual Studio IDE is not rendering page in desing mode if i use Shinkansen control.
Debug and Release usage must be configurable for the control.

if DEBUG

endif

block is not working..

hakank wrote Jan 3, 2012 at 12:13 PM

Visual Studio IDE is not rendering page in desing mode if i use Shinkansen control.
Debug and Release usage must be configurable for the control.

if DEBUG

endif

block is not working..

wrote Jan 24, 2012 at 5:08 PM

wrote Feb 13, 2013 at 10:32 PM