Solved

asp.net bundle

Posted on 2016-11-05
8
59 Views
Last Modified: 2016-11-15
http://madskristensen.net/post/performance-tuning-tricks-for-aspnet-and-iis-7-e28093-part-2

I followed exact same way above but my website still have alert below.
The only different is the folder name. Do you have any ideas how to fix it?

Sequence contains no elements

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.InvalidOperationException: Sequence contains no elements

Source Error:


Line 113:                string absolutePath = HostingEnvironment.MapPath(relativePath);
Line 114:                FileInfo[] files = FindFiles(absolutePath);
Line 115:                DateTime lastModified = files.Max(f => f.LastWriteTime);
Line 116:
Line 117:                int index = relativePath.LastIndexOf('/') + 1;
0
Comment
Question by:ITsolutionWizard
  • 5
  • 2
8 Comments
 
LVL 22

Expert Comment

by:Snarf0001
ID: 41875511
What version of .net are you running?
Have you looked at the nuget optimization package?  It's generally included in most project templates in VS, and will do 99% of the underlying work for you (including watching for file modifications and rewriting the bundle).

Very efficient, and no point re-inventing the wheel.

If for some reason you can't use it, would need more info on your file structure and code to see what the problem could be.  But looks like it's not finding the files, which "possibly" could be due to a lock when overwriting.
0
 
LVL 1

Author Comment

by:ITsolutionWizard
ID: 41875517
Framework 4.0
0
 
LVL 1

Author Comment

by:ITsolutionWizard
ID: 41875648
Any ideas?
0
Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

 
LVL 22

Expert Comment

by:Snarf0001
ID: 41876242
If it's 4.0, I would try the MS bundling package.
Nuget under:
https://aspnetoptimization.codeplex.com/

You have to modify some global.asax items and add a few things, but documentation and online samples should get you there.  Very quick and easy to use and does most of the heavy lifting.

If you make a new project it should already be included, which may help in the setup steps just for reference.

If you don't want to use that, as mentioned, would need more details on file structure, and what / when / how often your getting exceptions.
0
 
LVL 1

Author Comment

by:ITsolutionWizard
ID: 41876386
Sound good but how to use it !?
0
 
LVL 75

Accepted Solution

by:
käµfm³d   👽 earned 500 total points
ID: 41876965
You need to debug your FindFiles method--it's returning no items.
0
 
LVL 1

Author Comment

by:ITsolutionWizard
ID: 41877347
I downloaded it and how to work with my existing solution ?
0
 
LVL 1

Author Closing Comment

by:ITsolutionWizard
ID: 41889008
FindFiles works to me
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question